Re: GtkStatusbar and DGSEAL_ENABLE

2011-04-20 Thread Javier Jardón
On 9 April 2011 19:44, Carlos Pereira jose.carlos.pere...@ist.utl.pt wrote:
 Hi there,

Hello Carlos,

 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.

Could you comment in this bug? [1]

Thanks

[1] https://bugzilla.gnome.org/show_bug.cgi?id=594535
-- 
Javier Jardón Cabezas
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

GtkStatusbar and DGSEAL_ENABLE

2011-04-09 Thread Carlos Pereira

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


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list