Re: Re: winsow icon
| From: | Holger Seidenberg | Date: | Sat, 31 May 2003 10:14:19 +0000 |
| Subject: | Re: Re: winsow icon | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3499@lists.php.net to get a copy of this message | ||
On Fri, 2003-05-30 at 12:33, Jonas Koch Bentzen wrote:
> Holger Seidenberg wrote:
> >
> > how can i set the window icon ???
> > i think GDK::set_icon() will do this,
> > but it requires 3 arguments
>
> This seems to work:
>
thanks this works fine
> $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/
>