Solved

How to make a Gtk+ widget overlap an osgGtk widget

Posted on 2010-11-18
3
738 Views
Last Modified: 2012-05-10
Hello Experts!

I have a Gtk+ application with a widget that displays an OSG view using the osgGtk project (see http://sourceforge.net/projects/osggtk/).

I am using a gtk_fixed widget so that I can place all of my widgets exactly where I want them, and I want to make the OSG widget the size of the entire screen and then place buttons, images, etc. on top of the OSG widget.

Normally I can use the gtk_fixed to make widgets overlap if I want to, but the osgGtk widget is always on top of everything else, despite my best efforts. Is there a way to tell Gtk+ that I always want a widget to appear in the foreground, on top of whatever is behind it? I'll post some skeleton code to show what I'm doing below.

Please let me know how I can help and thanks in advance for your help!

P.S. There's no Gtk+ or OSG zones in Experts Exchange, so if anyone can suggest a different zone than what I've listed, please let me know!
GtkWidget *pFixedContainer;
GtkWidget *pFrameImage;
GtkWidget *pOsgWidget;

...
// make the image widget and the osg widget
...

gtk_widget_set_size_request(pOsgWidget, SCREEN_WIDTH, SCREEN_HEIGHT);

gtk_widget_set_size_request(pFrameImage, 100, 50);

...

gtk_fixed_put(GTK_FIXED(pFixedContainer), pOsgWidget, 0, 0);
gtk_fixed_put(GTK_FIXED(pFixedContainer), pFrameImage, 100, 100);

// I want the pFrameImage to be on top of the pOsgWidget, but the pOsgWidget is always on top!

Open in new window

0
Comment
Question by:ehensens
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 34177462
"Always on top" is is implemented by the Window Manager. I know you can talk to the WM in Tk (which is about the extent of my graphics experience) - can you do it with GTK?
0
 

Accepted Solution

by:
ehensens earned 0 total points
ID: 34485733
I had forgotten about this question, I apologize for letting it go abandoned. The answer to this question is that the Gtk widget that you display from the osgGtk source is derived from a GtkDrawingArea widget, which does not have a transparent background.
0
 

Author Closing Comment

by:ehensens
ID: 34514866
I am accepting my own solution because there was not much feedback, and I found out the answer on my own.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Advice on ESXi 5.1 Health / Storage 1 80
DB2 - How to load results from a Stored Procedure into a table 8 34
IMAP copying tool 14 76
cmake and message 1 23
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question