LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Showing a widget above a widget in GTK (http://www.linuxquestions.org/questions/programming-9/showing-a-widget-above-a-widget-in-gtk-685869/)

aarontwc 11-24-2008 09:09 PM

Showing a widget above a widget in GTK
 
I am currently modifying the gtkVNC Widget and I am trying to overlay a button above the gtkVNC Widget when my mouse is on top i.e. y < 10.

I am having trouble overlaying a gtkButton above a gtkVNC widget. In fact, I have problems overlaying a widget above a widget.

Any idea if this can be done? How do i put a widget above a widget? I am trying to but a button widget above a gtkVNC container widget.

Thanks
aaron

maradnus 11-24-2008 10:04 PM

Just a tip:

Try to give parent-child relationship to the widgets.


Thanks

aarontwc 11-24-2008 10:22 PM

Hi there,

First off, thank so much for replying!

I tried setting a parent child raltionship. I understand it is very simply:
gtk_container_add(MYCONTAINER, MYBUTTON);

But that didn't solve it. The button is still on top of the container and not overlayed on the container.

In HTML, div has something like this call Z-INDEX, but is there something like this in GTK?

This is how it looks like currently:
----------------------------
| button here |
----------------------------
| |
| |
| |
----------------------------

But I need it like this:

----------------------------
| |
| button here |
| |
| |
| |
----------------------------

Any ideas? Thank you!

swift2008 11-24-2008 11:20 PM

Quote:

Originally Posted by aarontwc (Post 3353465)
Hi there,

First off, thank so much for replying!

I tried setting a parent child raltionship. I understand it is very simply:
gtk_container_add(MYCONTAINER, MYBUTTON);

But that didn't solve it. The button is still on top of the container and not overlayed on the container.

In HTML, div has something like this call Z-INDEX, but is there something like this in GTK?

This is how it looks like currently:
----------------------------
| button here |
----------------------------
| |
| |
| |
----------------------------

But I need it like this:

----------------------------
| |
| button here |
| |
| |
| |
----------------------------

Any ideas? Thank you!

you may get the solution from here.
http://www.gtkforums.com/
http://www.gtk.org/tutorial1.2/gtk_tut-2.html#ss2.1

dmease 11-26-2008 11:40 AM

I have been able to do similar things by packing two widgets into the same cell of a table widget. Experiment in glade until you get it how you want it.


All times are GMT -5. The time now is 09:05 AM.