summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index cf69a87..a148210 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -12,7 +12,7 @@
#define BOX_BORDER 0
#define FRAME_SPACING 1
#define FRAME_BORDER 0
-#define PAGE_SPACING 0
+#define PAGE_SPACING 1
rcc_ui_internal rccUiCreateInternal(rcc_ui_context ctx) {
return NULL;
@@ -100,7 +100,6 @@ int rccUiMenuConfigureWidget(rcc_ui_menu_context ctx) {
if (!languages) return -1;
list = gtk_menu_new();
- gtk_widget_show(list);
for (i=0; languages[i]; i++) {
item = gtk_menu_item_new_with_label(rccUiGetLanguageName(uictx, languages[i]->sn));
gtk_widget_show(item);
@@ -114,7 +113,6 @@ int rccUiMenuConfigureWidget(rcc_ui_menu_context ctx) {
if (ctx->widget) menu = ctx->widget;
else {
menu = gtk_option_menu_new();
- gtk_widget_show(menu);
ctx->widget = menu;
}
gtk_option_menu_remove_menu(GTK_OPTION_MENU(menu));
@@ -128,7 +126,6 @@ int rccUiMenuConfigureWidget(rcc_ui_menu_context ctx) {
if (!charsets) return -1;
list = gtk_menu_new();
- gtk_widget_show(list);
for (i=0;charsets[i];i++) {
item = gtk_menu_item_new_with_label(rccUiGetCharsetName(uictx,charsets[i]));
gtk_widget_show(item);
@@ -138,7 +135,6 @@ int rccUiMenuConfigureWidget(rcc_ui_menu_context ctx) {
if (ctx->widget) menu = ctx->widget;
else {
menu = gtk_option_menu_new();
- gtk_widget_show(menu);
ctx->widget = menu;
}
@@ -157,7 +153,6 @@ int rccUiMenuConfigureWidget(rcc_ui_menu_context ctx) {
if (!engines) return -1;
list = gtk_menu_new();
- gtk_widget_show(list);
for (i=0;engines[i];i++) {
item = gtk_menu_item_new_with_label(rccUiGetEngineName(uictx,engines[i]->title));
gtk_widget_show(item);
@@ -167,7 +162,6 @@ int rccUiMenuConfigureWidget(rcc_ui_menu_context ctx) {
if (ctx->widget) menu = ctx->widget;
else {
menu = gtk_option_menu_new();
- gtk_widget_show(menu);
ctx->widget = menu;
}
@@ -183,7 +177,6 @@ int rccUiMenuConfigureWidget(rcc_ui_menu_context ctx) {
case RCC_OPTION_RANGE_TYPE_BOOLEAN:
if (!ctx->widget) {
item = gtk_check_button_new_with_label(rccUiGetOptionName(uictx, rccUiMenuGetOption(ctx)));
- gtk_widget_show(item);
ctx->widget = item;
}
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ctx->widget), rccGetOption(rccctx, rccUiMenuGetOption(ctx)));
@@ -196,7 +189,6 @@ int rccUiMenuConfigureWidget(rcc_ui_menu_context ctx) {
if (!optnames) return -1;
list = gtk_menu_new();
- gtk_widget_show(list);
for (i=0;optnames[i];i++) {
item = gtk_menu_item_new_with_label(optnames[i]);
gtk_widget_show(item);
@@ -204,7 +196,6 @@ int rccUiMenuConfigureWidget(rcc_ui_menu_context ctx) {
}
menu = gtk_option_menu_new();
- gtk_widget_show(menu);
ctx->widget = menu;
gtk_option_menu_remove_menu(GTK_OPTION_MENU(menu));
@@ -227,7 +218,6 @@ int rccUiMenuConfigureWidget(rcc_ui_menu_context ctx) {
rcc_ui_box rccUiBoxCreate(rcc_ui_menu_context ctx, const char *title) {
GtkWidget *hbox, *label;
hbox = gtk_hbox_new(FALSE, BOX_SPACING);
- gtk_widget_show(hbox);
gtk_container_border_width(GTK_CONTAINER(hbox), BOX_BORDER);
if ((ctx->type != RCC_UI_MENU_OPTION)||(rccUiMenuGetRangeType(ctx) != RCC_OPTION_RANGE_TYPE_BOOLEAN)) {
label = gtk_label_new(title);
@@ -235,6 +225,7 @@ rcc_ui_box rccUiBoxCreate(rcc_ui_menu_context ctx, const char *title) {
gtk_widget_set_usize(label, TITLE_WIDTH, TITLE_HEIGHT);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
}
+ gtk_widget_show((GtkWidget*)ctx->widget);
gtk_box_pack_start(GTK_BOX(hbox), (GtkWidget*)ctx->widget, TRUE, TRUE, 0);
return (rcc_ui_box)hbox;
}
@@ -245,13 +236,12 @@ rcc_ui_frame rccUiFrameCreate(rcc_ui_frame_context ctx, const char *title) {
if (!ctx) return NULL;
frame = gtk_frame_new(title?title:"");
- gtk_widget_show(frame);
gtk_container_border_width(GTK_CONTAINER(frame), FRAME_BORDER);
box = gtk_vbox_new(FALSE, FRAME_SPACING);
gtk_widget_show(box);
gtk_container_add(GTK_CONTAINER(frame), box);
-
+
return (rcc_ui_frame)frame;
}
@@ -265,6 +255,7 @@ int rccUiFrameAdd(rcc_ui_frame_context ctx, rcc_ui_box box) {
if ((!ctx)||(!box)) return -1;
vbox = gtk_container_children(GTK_CONTAINER(ctx->frame))->data;
+ gtk_widget_show(GTK_WIDGET(box));
gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(box), FALSE, FALSE, 0);
return 0;
}
@@ -272,12 +263,12 @@ int rccUiFrameAdd(rcc_ui_frame_context ctx, rcc_ui_box box) {
rcc_ui_page rccUiPageCreate(rcc_ui_context ctx, const char *title) {
GtkWidget *vbox;
vbox = gtk_vbox_new(FALSE, PAGE_SPACING);
- gtk_widget_show(vbox);
return (rcc_ui_page)vbox;
}
int rccUiPageAdd(rcc_ui_page page, rcc_ui_frame frame) {
if ((!page)||(!frame)) return -1;
+ gtk_widget_show(frame);
gtk_box_pack_start(GTK_BOX(page), GTK_WIDGET(frame), FALSE, FALSE, 0);
return 0;
}