Re: Using alternate constructors
| From: | Christian Weiske | Date: | Thu, 15 Dec 2005 07:25:48 +0000 |
| Subject: | Re: Using alternate constructors | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6399@lists.php.net to get a copy of this message | ||
Hello Anant,
>>$toolbutton = new GtkToolButton::new_from_stock("gtk-ok");
Erm, you have to pass an integer and not a string. Use
Gtk::STOCK_OK
>>$toolbutton = new GtkToolButton("gtk-ok");
> returns an error: Parameter for GtkToolButton::__construct() must be a widget.
Dev_Inspector tells me:
> public __construct([GtkWidget icon_widget, label])
>>$menuitem = new GtkMenuItem("_File");
> gives me a proper mnemonified menu item with 'F' as an accelerator. I
> haven't mentioned new_with_mnemonic() anywhere!
We decided that all buttons automatically get set_mnemonic passed as
it's very likely that one wants to have a mnemonic on a button.
Other widgets, like GtkLabel, doesn't have that automatism and require
an extra function call.
You example with GtkToolButton is not the best one because toolbar
buttons normally have an icon and a text (even if only one is visible).
So the constructor requires the icon widget and the text for the label.
--
Regards/MfG,
Christian Weiske
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc