Ewl_Widget win win ewl_window_new ewl_window_title_set EWL_WINDOW win

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Ewl_Widget *win, *o;
win = ewl_window_new();
ewl_window_title_set(EWL_WINDOW(win), "FBReader");
ewl_window_class_set(EWL_WINDOW(win), "fbreader");
ewl_window_name_set(EWL_WINDOW(win), "fbreader");
ewl_object_fill_policy_set(EWL_OBJECT(win), EWL_FLAG_FILL_ALL);
ewl_object_size_request(EWL_OBJECT(win), 600, 800);
ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, cb_window_close, application);
ewl_callback_append(win, EWL_CALLBACK_KEY_DOWN, cb_key_down, application);
ewl_callback_append(win, EWL_CALLBACK_DESTROY, cb_window_destroy, application);
ewl_widget_name_set(win, "main_win");
ewl_widget_show(win);
o = ewl_image_new();
EWL_IMAGE(o)->image = NULL;
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_FILL);
ewl_container_child_append(EWL_CONTAINER(win), o);
ewl_callback_append(o, EWL_CALLBACK_REVEAL, cb_image_reveal, this);
ewl_object_position_request(EWL_OBJECT(o), CURRENT_X(win), CURRENT_Y(win));
ewl_object_size_request(EWL_OBJECT(o), CURRENT_W(win), CURRENT_H(win));
ewl_widget_name_set(o, "image");
ewl_widget_show(o);