GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Mon Aug 29, 2016 2:43 pm

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Creating an invisible widget (PROBLEM & SOLUTION)
PostPosted: Mon Oct 29, 2007 2:18 pm 
Familiar Face

Joined: Wed Oct 03, 2007 12:28 pm
Posts: 25
Location: Virginia (Northern)
I wanted to create an invisible widget to swap out during run-time with another widget based on the the program's context and user selection.

The problem that I ran into was that the functions:
gtk_widget_hide() and gtk_widget_show() worked fine for me after the widget(s) were initially rendered... but I didn't want to have to display it until it was needed (and didn't really want to create it on the fly either.)

After a LOT of experimentation, and undesirable "work-arounds", I searched for an appropriate property and discovered (within Krause's book) the "no-show-all" GtkWidget" property which prevents the widget from "initially" being displayed. I then used gtk_widget_show() & gtk_widget_hide() during runtime to manage display of the widget.
So... in essence, it is as simple as:
g_object_set( widget, "no-show-all",   TRUE, NULL);

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group