[pygtk] menu and notebook not staying on a same window.
Felipe Reyes
felipereyes at gmail.com
Fri Mar 7 03:51:46 WST 2008
hi,
On Mon, 2008-03-03 at 22:56 +0530, krishnakant Mane wrote:
> hello,
> I am creating an application where there is a menu bar and I also need
> to have a notebook on that same window.
> when any menu item is clicked the notebook will be loaded with the
> respective page.
> but when I add the menu and notebook I get the following.
> GtkWarning: Attempting to add a widget with type GtkNotebook to a
> GtkWindow, but as a GtkBin subclass a GtkWindow can only contain one
> widget at a time; it already contains a widget of type GtkMenuBar
> self.win.add(self.notebook)
> =
> can any one tell me how to get around this?
it looks like you are trying to use the .add() method with a widget that
already has a child, to avoid this you gtk.HBox, gtk.VBox or some
container that is capable of handle more than 1 child widget.
for example
...
box =3D gtk.HBox()
button =3D gtk.Button(label=3D"My Button")
box.pack_start(button)
label =3D gtk.Label("Just a label")
box.pack_start(label)
some_window.ad(box)
...
i hope to be clear ;)
regards,
-- =
Felipe Reyes A.
Estudiante de Ingenier=EDa Ejecuci=F3n Inform=E1tica
Universidad de Santiago de Chile
counter.li.org #316380
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20080306/f3a7983d/a=
ttachment.pgp
More information about the pygtk
mailing list