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 Sep 01, 2014 1:46 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: My custom GtkWindow object from GtkBuilder
PostPosted: Tue Jan 24, 2012 2:17 pm 
Offline
Familiar Face

Joined: Tue Dec 13, 2011 2:36 pm
Posts: 5
Hi all.
I read all documentation I can and I don't find an answer to my question (maybe I need to read more).

I draw a GtkWindow with Glade3.
GtkWindow->GtkVBox->GtkButton

Now I'd like to implement my custom widget derived from a GtkWindow, which loads the definition from glade file.

If I try to load the GtkWindow in the glade file I'll get a standard GtkWindow pointer.
But I need the layout defined with glade, loaded in my custom window widget.

Maybe it's a sort of subclass of standard GtkWindow.

Any idea?

Thanks to all.


Top
 Profile  
 
 Post subject: Re: My custom GtkWindow object from GtkBuilder
PostPosted: Thu Jan 26, 2012 1:00 pm 
Offline
Never Seen the Sunlight

Joined: Wed Jul 23, 2008 10:31 am
Posts: 2406
Location: Slovenia
Hello.

I can think of 2 possible ways of achieving what you want. The simpler one is to manually create your custom toplevel window from code, construct subtree in Glade (so your GtkVBox is the toplevel container for the hierarchy) and then insert this subtree into your window.

The complex way of dealing with this would be to create custom widget for your toplevel window, create catalog file for glade and then you'll be able to create the whole thing in glade.

Cheers,
Tadej


Top
 Profile  
 
 Post subject: Re: My custom GtkWindow object from GtkBuilder
PostPosted: Thu Jan 26, 2012 2:05 pm 
Offline
Familiar Face

Joined: Tue Dec 13, 2011 2:36 pm
Posts: 5
Thanks for the answer.

I choose to make the GtkWindow with the code, a than load the subwidgets from a Glade tree using GtkBuilder interface.

So I can draw the gui with glade faster than I could with the code.


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: No registered users and 1 guest


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