Re: Windows & backgrounds

From: Date: Fri, 06 Aug 2004 16:52:05 +0000
Subject: Re: Windows & backgrounds
References: 1 2  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-4939@lists.php.net to get a copy of this message
First of all let me tell you what I'm to do: I'm trying to do a weather program. something that will tell me what's the weather in my city(no, i didn't stole your idea :), I've already did this thing using karamba&php almost a year ago and I've thought it would be nice to do it with php-gtk and use it on my windows machine) I've managed to put the image in the background. But now I have another problem. The images I add are not transparent. Here is what I've did so far: <?php dl('php_gtk.'.PHP_SHLIB_SUFFIX); $window = &new GtkWindow(GTK_WINDOW_DIALOG); $window->connect_object('destroy', array('gtk', 'main_quit')); $window->set_uposition(gdk::screen_width()/3.7, gdk::screen_height()/4); $window->realize(); list($pixmap, $mask) = gdk::pixmap_create_from_xpm($window->window, null, dirname(__FILE__).'/images/bg.xpm'); list($pixmap1, $mask1) = gdk::pixmap_create_from_xpm($window->window, null, dirname(__FILE__).'/images/10.xpm'); $tpixmap1 = &new GtkPixmap($pixmap1, $mask1); $tpixmap = &new GtkPixmap($pixmap, $mask); $window->unrealize(); $window->shape_combine_mask($mask, 0, 0); $vbox = &new GtkVBox(); $vbox->pack_start($tpixmap1); $vbox->pack_start(new GtkButton('test')); $vbox->add($tpixmap); $vbox->show_all(); $window->add($vbox); $window->show_all(); gtk::main_iteration(); gtk::main(); ?> I don't know if the trick with $vbox->pack_start() and then $vbox->add() is bug or a feature but it works(only if I do pack_start() first and then add()) on my linux machine(I'll test it on windows later). If you have any code on how to make the images transparent or maybe another way to achieve this I'll be very grateful. ps: sorry for my bad english Regards, Cosmin Budinschi On Fri, 2004-08-06 at 18:53, Joel De Gan wrote: > (sorry didn't click to send to the list as well as you) > > Hi, I wrote that tutorial. > > Yes it is. > Look over the functions and you will see the function that creates the > base XPM that I use to draw on. > You can replace that with a different image (i.e. a transparent image > with a border) and draw on that as you need. I have played around with > LCD-like interfaces that do mouse-overs and hold button state etc. > > But that base xpm function is the one you need to focus on. > > -joeldg > > On Fri, 06 Aug 2004 14:46:33 +0300, Cosmin <cosminb@as.ro> wrote: > > Is it possible to put an image(.xpm) as background to a window? or at > > least to make the window transparent? > > > > I've read this tutorial: > > http://lucifer.intercosmos.net/tut/ but it only > > modifies some xpms and then displays them. > > I need to put an image in the background and the add some buttons and > > other stuff(who will also be images or created from one with > > shape_combine_mask()) to the window. > > > > -- > > PHP-GTK General Mailing List (http://gtk.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > >

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