GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sun Oct 26, 2014 12:18 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Subclassing GtkBin or GtkContainer
PostPosted: Tue Jun 10, 2008 3:27 am 
Offline
Never Seen the Sunlight

Joined: Thu Jun 14, 2007 11:02 pm
Posts: 923
Location: Falun, WI USA
Hi, I'm writing a widget (in C) and I'd like to have its parent be GtkBin or GtkContainer (just so that it has one item packed into it).
I've tried doing it with GtkBin, but whatever is packed into my widget is never shown.
I seem to recall that you need to manually implement something to subclass GtkContainer, but I don't remember what.
Is there something that I need to do to make children mapped/realized/shown?
Thanks...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 10, 2008 3:33 am 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
I couldn't say, however, I would take a look at gtkbutton.c in the GTK+ sources or some other widget directly derived from GtkBin.

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 10, 2008 8:18 pm 
Offline
Never Seen the Sunlight

Joined: Thu Jun 14, 2007 11:02 pm
Posts: 923
Location: Falun, WI USA
I ended up looking at the source for, and subclassing GtkTable, (which is a subclass of GtkContainer) because it implements all of the container class functions (add, remove etc.).
Also, since a table with 1 row and 1 column is pretty much just a container, it works just fine for me.
Thanks for your help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Yahoo [Bot] and 4 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