ui/gtk/webview.c

changeset 801
e096c441e874
parent 730
c812d7038731
child 842
2ba50231b255
equal deleted inserted replaced
800:814d374fb689 801:e096c441e874
32 #include "webview.h" 32 #include "webview.h"
33 33
34 #ifdef UI_WEBVIEW 34 #ifdef UI_WEBVIEW
35 35
36 UIWIDGET ui_webview_create(UiObject *obj, UiWebviewArgs *args) { 36 UIWIDGET ui_webview_create(UiObject *obj, UiWebviewArgs *args) {
37 UiObject* current = uic_current_obj(obj);
38
39 GtkWidget *webview = webkit_web_view_new(); 37 GtkWidget *webview = webkit_web_view_new();
40 38
41 ui_set_name_and_style(webview, args->name, args->style_class); 39 ui_set_name_and_style(webview, args->name, args->style_class);
42 40
43 UiVar *var = uic_widget_var(obj->ctx, current->ctx, args->value, args->varname, UI_VAR_GENERIC); 41 UiVar *var = uic_widget_var(obj->ctx, obj->ctx, args->value, args->varname, UI_VAR_GENERIC);
44 if(var) { 42 if(var) {
45 WebViewData *data = malloc(sizeof(WebViewData)); 43 WebViewData *data = malloc(sizeof(WebViewData));
46 memset(data, 0, sizeof(WebViewData)); 44 memset(data, 0, sizeof(WebViewData));
47 data->webview = WEBKIT_WEB_VIEW(webview); 45 data->webview = WEBKIT_WEB_VIEW(webview);
48 WebKitSettings *settings = webkit_web_view_get_settings(data->webview); 46 WebKitSettings *settings = webkit_web_view_get_settings(data->webview);
58 ui_webview_set(value, value->value, UI_WEBVIEW_OBJECT_TYPE); 56 ui_webview_set(value, value->value, UI_WEBVIEW_OBJECT_TYPE);
59 } 57 }
60 } 58 }
61 59
62 ui_set_widget_groups(obj->ctx, webview, args->groups); 60 ui_set_widget_groups(obj->ctx, webview, args->groups);
63 UI_APPLY_LAYOUT2(current, args); 61 UiContainerPrivate *ct = (UiContainerPrivate*)obj->container_end;
64 current->container->add(current->container, webview); 62 UiLayout layout = UI_ARGS2LAYOUT(args);
63 ct->add(ct, webview, &layout);
65 64
66 return webview; 65 return webview;
67 } 66 }
68 67
69 void* ui_webview_get(UiGeneric *g) { 68 void* ui_webview_get(UiGeneric *g) {

mercurial