Re: Place an widget or image on top of an image!?



"JOSE PEDRO SERGIO ROMAO MACHADO" wrote:

I need to do some software that represents an Controling 
System of a House.

I have to put an top side image of the house an some leds 
on each division, like green the room is empty, red room 
is not empty...

My problem is that, unlyke QT, GTK+ doesn't seem to have 
the Z coordinate.. that sets the deep of an widget.. so 
you can place widget on top of each other...

Any sugestions??? 

Probably there won't be a straight way to achieve this. However, I
suggest you have a look at various threads of the past months in this
list, which address the issue of placing a background image into windows
/ widgets. Search for keywords like "background", "image" / "images",
"picture" / "pictures" and "transparent" / "transparency" in this list.
You should find something helpful then.

Once you have filled your window or container with a (background) image
of your house you could use a GtkFixed container (allow me a yuck!) to
place your "leds" (I suppose some kind of button widgets for those) at
the right positions above the picture.

Make sure you read the section "Description" at
http://developer.gnome.org/doc/API/2.0/gtk/GtkFixed.html to learn about
negative implications of GtkFixed and why not to use it otherwise.

By the way, if you manage to make your image scaleable, according to the
window being resized by the user, and if you don't need to place your
"led" widgets with a pixel-wise precision (which is a bad idea anyway),
then a GtkTable may provide you with a more dynamic solution to place
your "leds" at certain grid positions than GtkFixed does.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]