Re: Pixmaps and Buttons

From: Date: Wed, 30 Aug 2006 12:13:58 +0000
Subject: Re: Pixmaps and Buttons
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-7145@lists.php.net to get a copy of this message
Hi Andrew, I don't have any specific values to give you that will align things right but I have experienced the same thing before. I have found that there is a child container inside of the button object that you should use to hold the pixmap. ($button->child->add() instead of $button->add()) There is a PHP-GTK 1 example in the PEAR package Gtk_Styled that modifies the shape and contents of a GtkButton. In that package I only had to offset the pixmap by one pixel. Hope that helps, Scott Mattocks Andrew Buczacki wrote:
I'm trying to make a custom button for an application I'm writing. I have a button that has a unique shape (also, I want to get rid of that button border). Anyway, I use shape_combine_mask to create the button shape, and I try to add a pixmap to it (via button->add($pixmap)). Unfortunately, this produces strange results. Usually I won't see anything at all, but if I fiddle with boxes and packing options, I can sometimes get a corner of the pixmap to appear in my button area. Is this normal? Is there some sort of internal packing in a GtkButton that would screw up pixmap placement? Does anyone have any tips on how to make a pixmap a button? Thanks in advance, Andrew
-- Scott Mattocks Author of: Pro PHP-GTK http://www.crisscott.com

« previous php.gtk.general (#7145) next »