[9173] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: padding on buttons w/text

daemon@ATHENA.MIT.EDU (Tim Janik)
Sun Oct 11 00:52:45 1998

From: Tim Janik <timj@gtk.org>
Date: Sun, 11 Oct 1998 05:52:44 +0200 (CEST)
To: gtk-list@redhat.com
In-Reply-To: <199810091403.QAA00172@tcs18.nada.kth.se>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

On Fri, 9 Oct 1998, Johannes Keukelaar wrote:

> //"Damon Chaplin" <DAChaplin@email.msn.com> wrote:
> //> 
> //>   button = gtk_button_new_with_label ("Hello World");
> //>   gtk_misc_set_padding (GTK_MISC (GTK_BUTTON (button)->child)), 20,
> //> 10)
> //
> //Damon,
> //
> //Best solution I've seen; way better than the pile of widgets I was
> //having at.  I was not aware that you could generically refer to a child
> //widget like that.
> 
> That depends on what you mean with 'refer to a child widget like that'. Button 
> widgets allow you to access their child widget like that (GTK_BUTTON (button)->
> child). If you create the button with gtk_button_new_with_label, then, not very 
> surprisingly, the child you access that way is a GTK_LABEL widget. Label 
> widgets are descendents (classwise) of GTK_MISC widgets. Misc widgets (and 
> therefor labels) allow you to set the padding like that.

in the development version (i.e. 1.1.x), the GtkButton.child member is actually
deprecated and may get removed with some future Gtk+ version.
the correct way to retrive the child pointer there is GTK_BIN (button)->child.

> 
> Regards,
> 
> Johannes.
> 

---
ciaoTJ

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post