Re: Windows & backgrounds

From: Date: Fri, 06 Aug 2004 16:59:38 +0000
Subject: Re: Windows & backgrounds
References: 1 2 3  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-4940@lists.php.net to get a copy of this message
I would need to see the XPM's you are using. In the heading of the XPM, the color set for transparent needs to be set to "None" in the colors definitions (it is always at the top).. From a quick glance, it looks like you have everything set correctly in how you are creating the images for display, so I will assume that the XPM itself does not have transparency set.. please correct me if I am wrong. I am assuming you are trying to do something similar to what I did here: http://lucifer.intercosmos.net/images/screenshot_2003-05-23_16:31:51.png (on the right, the weather applet; that one is actually done in PHP, but not done in php-gtk, it is a script that paints to the background image and then refreshes the background image once every few hours, but just for how it looks I am assuming that is what you are going for). If you have a website somewhere that you can post the images you are trying to use, it would help to see and I would be more than happy to set up the image for you. -joeldg On Fri, 06 Aug 2004 19:52:05 +0300, Cosmin <cosminb@as.ro> wrote: > 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 > > > > > > > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

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