Reply
Thread Tools
taguapire's Avatar
Posts: 107 | Thanked: 14 times | Joined on Dec 2007
#1
Hi,

I'm working on Python apps, just for learn and I found that when I add two containers to a hildon window it returns an error. I trying to add a VBox and HButtonBox containers, first for labels, second for buttons, but Gtk complain with the following message:

GtkWarning: Attempting to add a widget with type GtkHButtonBox to a HildonWindow, but as a GtkBin subclass a HildonWindow can only contain one widget at a time; it already contains a widget of type GtkVBox
How I can fix this issue? What are my options?

Regards,

Taguapire.
 

The Following User Says Thank You to taguapire For This Useful Post:
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#2
You can't add two container in a frame ...

Create a global container to contain your VBOx and HButtonBox ...

Or add you HButtonBox inside your vbox
 
taguapire's Avatar
Posts: 107 | Thanked: 14 times | Joined on Dec 2007
#3
Originally Posted by Khertan View Post
You can't add two container in a frame ...

Create a global container to contain your VBOx and HButtonBox ...

Or add you HButtonBox inside your vbox
Can you show me the code for do that? I don't know how to nest every container.

I mean, an example for each case.

Regards,

Taguapire.

Last edited by taguapire; 2008-01-15 at 05:58.
 
yerga's Avatar
Posts: 696 | Thanked: 1,012 times | Joined on Mar 2006 @ Asturies, Spain
#4
This is the second case, I always write it so:

Code:
window = hildon.Window()
vbox1 = gtk.VBox()
hbuttonbox1 = gtk.HButtonBox()
vbox1.pack_start(hbuttonbox1, False, False, 0)
window.add(vbox1)
More information about packing widgets: http://pygtk.org/pygtk2tutorial/ch-PackingWidgets.html
__________________
Daniel Martín Yerga
maemo.org profile
Twitter
 

The Following User Says Thank You to yerga For This Useful Post:
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#5
I think u should use lib glade ... it ll be more easy to start ...

https://help.ubuntu.com/community/UM...onForUMEHildon
 
pycage's Avatar
Posts: 3,404 | Thanked: 4,474 times | Joined on Oct 2005 @ Germany
#6
There are containers which can only take one child (Window, Frame, EventBox, ...) and containers which can take a number of children (HBox, VBox, Table, Fixed, Layout, HSplitpane, VSplitpane, ...).
Those which take more than one child are usually used for layouting the GUI elements, while the one-child-containers serve for decorating (Frame) or capturing user events (EventBox).
If you play around with Glade a bit, you'll notice this difference.
 
taguapire's Avatar
Posts: 107 | Thanked: 14 times | Joined on Dec 2007
#7
Where I can find more info about glade an maemo?

If I use glade, will my app be slower?

Regards,

Taguapire.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 01:09.