summaryrefslogtreecommitdiff
path: root/iup/src/gtk/iupgtk_frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'iup/src/gtk/iupgtk_frame.c')
-rwxr-xr-xiup/src/gtk/iupgtk_frame.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/iup/src/gtk/iupgtk_frame.c b/iup/src/gtk/iupgtk_frame.c
index 022c6c7..25595be 100755
--- a/iup/src/gtk/iupgtk_frame.c
+++ b/iup/src/gtk/iupgtk_frame.c
@@ -41,8 +41,11 @@ static char* gtkFrameGetTitleAttrib(Ihandle* ih)
static int gtkFrameSetTitleAttrib(Ihandle* ih, const char* value)
{
- GtkFrame* frame = (GtkFrame*)ih->handle;
- gtk_frame_set_label(frame, iupgtkStrConvertToUTF8(value));
+ if (iupAttribGetStr(ih, "_IUPFRAME_HAS_TITLE"))
+ {
+ GtkFrame* frame = (GtkFrame*)ih->handle;
+ gtk_frame_set_label(frame, iupgtkStrConvertToUTF8(value));
+ }
return 0;
}
@@ -57,7 +60,11 @@ static int gtkFrameSetBgColorAttrib(Ihandle* ih, const char* value)
if (label)
iupgtkBaseSetBgColor(label, r, g, b);
- iupgtkBaseSetBgColor(ih->handle, r, g, b);
+ if (iupAttribGet(ih, "_IUPFRAME_HAS_BGCOLOR"))
+ {
+ GtkWidget* fixed = gtk_bin_get_child((GtkBin*)ih->handle);
+ iupgtkBaseSetBgColor(fixed, r, g, b);
+ }
return 1;
}
@@ -120,10 +127,19 @@ static int gtkFrameMapMethod(Ihandle* ih)
gtk_frame_set_shadow_type((GtkFrame*)ih->handle, GTK_SHADOW_IN);
else
gtk_frame_set_shadow_type((GtkFrame*)ih->handle, GTK_SHADOW_ETCHED_IN);
+
+ if (iupAttribGet(ih, "BGCOLOR"))
+ iupAttribSetStr(ih, "_IUPFRAME_HAS_BGCOLOR", "1");
}
/* the container that will receive the child element. */
fixed = gtk_fixed_new();
+ if (iupAttribGet(ih, "_IUPFRAME_HAS_BGCOLOR"))
+#if GTK_CHECK_VERSION(2, 18, 0)
+ gtk_widget_set_has_window(fixed, TRUE);
+#else
+ gtk_fixed_set_has_window((GtkFixed*)fixed, TRUE);
+#endif
gtk_container_add((GtkContainer*)ih->handle, fixed);
gtk_widget_show(fixed);