Re: winsow icon
| From: | Jonas Koch Bentzen | Date: | Fri, 30 May 2003 10:33:46 +0000 |
| Subject: | Re: winsow icon | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3490@lists.php.net to get a copy of this message | ||
Holger Seidenberg wrote:
how can i set the window icon ??? i think GDK::set_icon() will do this, but it requires 3 argumentsThis seems to work: $window = new GtkWindow(); $window->realize(); $GDKWindow = $window->window; $pixMapInfo = gdk::pixmap_create_from_xpm($GDKWindow, NULL, '/path/to/image.xpm'); $GDKWindow->set_icon(NULL, $pixMapInfo[0], $pixMapInfo[1]); If you're curious as to how I figured out which argument the method takes, this is the way: First I called set_icon() without any arguments (as it (incorrectly) says in the manual). PHP triggered an error: set_icon() requires three arguments. I didn't really know the arguments, so I just called the method with bogus arguments: ...set_icon(1, 1, 1); PHP triggered an error: The first argument needs to be a GdkWindow or NULL. I changed the first argument and went on to number two and so on. In short: If the manual is errornous, just make use of PHP-GTK's excellent error messages. -- Jonas Koch Bentzen http://findhim.com/