[67] in The GTK GIMP ToolKit mailing list archive

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

[gtk-list] Packing stuff in buttons

daemon@ATHENA.MIT.EDU (Raph Levien)
Thu May 8 12:44:35 1997

Date: Thu, 8 May 1997 09:45:12 -0700 (PDT)
From: Raph Levien <raph@acm.org>
To: gtk-list@redhat.com
In-Reply-To: <19970508122819.52287@redhat.com>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com



On Thu, 8 May 1997, Otto Hammersmith wrote:
> If you look at the source for gtk_button_new_with_label(), you'll see
> that all it's doing is creating a new button, then using
> gtk_container_add() to insert a label into the button.  So, create the
> button and pixmap, and use gtk_container_add() to put the pixmap in
> the button.  
> 
> You can even have both a label and a pixmap.. you should be able to
> have more than one label, and more than one pixmap, though I've never
> actually done it. :)

If you wanted to do this, you wouldn't just call gtk_container_add () 
twice -- once for the label and once for the pixmap. Instead, you'd 
create a box, pack the label and the pixmap into the box, and add the box 
into the button.

The button add method is a no-op if the button already contains 
something. However, you can nest things indefinitely in gtk+ by using 
containers, so it's no problem.

Raph

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


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