[Xfce4-commits] r17207 - libxfcegui4/trunk/libxfcegui4

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Wed Aug 31 22:18:42 CEST 2005


Brian J. Tarricone wrote:
> I'm ok with that.  I assume you mean that it returns the actual GtkFrame
> widget, and you pass a pointer to a GtkWidget* as box, which gets filled
> in with the frame's 'new' container widget?  So something like this:
> 
> GtkWidget *
> xfce_create_framebox(const gchar *title,
>                      GtkWidget **frame_bin)
> {
>     GtkWidget *framebox;
> 
>     g_return_val_if_fail(frame_bin, NULL);
> 
>     framebox = gtk_frame_new(NULL);
>     gtk_frame_set_shadow_type(GTK_FRAME(framebox), GTK_SHADOW_NONE);
>     gtk_frame_set_label_align(GTK_FRAME(framebox), 0.0, 1.0);
>     gtk_widget_show(framebox);
> 
>     if(title) {
>         gchar *tmp = g_strdup_printf("<b>%s</b>", title);
>         GtkWidget *label = gtk_label_new(tmp);
>         gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
>         gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
>         gtk_widget_show(label);
>         gtk_frame_set_label_widget(GTK_FRAME(framebox), label);
>         g_free(tmp);
>     }
> 
>     *frame_bin = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
>     gtk_alignment_set_padding(GTK_ALIGNMENT(*frame_bin), 5, 5, 21, 5);
>     gtk_widget_show(*frame_bin);
>     gtk_container_add(GTK_CONTAINER(framebox), *frame_bin);
> 
>     return framebox;
> }
> 
> Then the caller should add the return value to the parent widget, and
> add children to frame_bin.

Jeppa, something like that. I'd strongly suggest to add that method to
libxfcegui4, revert the XfceFramebox to the 4.2 state and deprecate it.

> 	-brian

Benedikt



More information about the Xfce4-dev mailing list