Fri, 11 Dec 2020 11:46:19 +0100
add drawingarea and textarea group
3
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | /* |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | * To change this license header, choose License Headers in Project Properties. |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | * To change this template file, choose Tools | Templates |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
4 | * and open the template in the editor. |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | */ |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | #include "browser.h" |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | #include <stdio.h> |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | #include <stdlib.h> |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | UIWIDGET document_browser_create(UiObject *obj) { |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | ui_layout_width(obj, 250); |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | UIWIDGET browser = ui_drawingarea(obj, browser_draw, NULL); |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | return browser; |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | } |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | void browser_draw(UiEvent *event, UiGraphics *g, void *udata) { |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | ui_graphics_color(g, 100, 100, 100); |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | ui_draw_rect(g, 0, 0, g->width, g->height, TRUE); |
c04433993fbb
add drawingarea and textarea group
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | } |