GtkStatusbar and DGSEAL_ENABLE
- From: Carlos Pereira <jose carlos pereira ist utl pt>
- To: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: GtkStatusbar and DGSEAL_ENABLE
- Date: Sat, 09 Apr 2011 19:44:49 +0100
Hi there,
In order to conform with -DGSEAL_ENABLE, I replaced this old code:
gtk_misc_set_alignment (GTK_MISC (GTK_STATUSBAR (statusbar)->label),
0.5, 0.5);
by this new one:
hbox = gtk_statusbar_get_message_area (GTK_STATUSBAR (statusbar));
label = GTK_WIDGET (gtk_container_get_children (GTK_CONTAINER
(hbox))->data);
gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
It compiles and runs fine, and it does what is expected to do.
Of course this code only works because the label is the first children
of the statusbar hbox container (the first node of the statusbar hbox
GList). If that changes in the future, this code will get broken...
Perhaps we could have a function:
label = gtk_statusbar_get_label (GTK_STATUSBAR (statusbar));
This way GTK developers could futurely change the inner workings of
GtkStatusbar without affecting user code that needs access to the Label.
Regards,
Carlos
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]