Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Pygobject Menu And Notebook?
#1
I added Notebook to my application. I used it with Grid. Now I want to add Menu. Gtk.Box () does this. But this time it gives an error and the empty window opens. What's the way to add this?

def __init__(self):
    Gtk.Window.__init__(self, title=info.__appname__)
    # self.set_default_size(500, 450)
    self.connect("destroy", Gtk.main_quit)

    vbox = Gtk.VBox()
    self.add(vbox)


    menu1 = Gtk.Menu()
    file = Gtk.MenuItem(label="_File")
    file.set_submenu(menu1)

    vbox.pack_start(menu1, False, False, 0)


    self.notebook = Gtk.Notebook()
    self.add(self.notebook)

    [..]
Quote:(gui.py:937): Gtk-CRITICAL **: 17:21:21.681: gtk_box_pack: assertion '_gtk_widget_get_parent (child) == NULL' failed

(gui.py:937): Gtk-WARNING **: 17:21:21.681: Attempting to add a widget with type GtkNotebook to a main+GUI, but as a GtkBin subclass a main+GUI can only contain one widget at a time; it already contains a widget of type GtkVBox
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Nesting menu buttons tkinter for python Mocap 1 117 Jul-18-2019, 11:46 AM
Last Post: metulburr
  [Tkinter] Adding space between Notebook tabs Columbo 4 274 Jul-10-2019, 10:46 PM
Last Post: Columbo
  [XFce]i am again looking for sample menu code Skaperen 6 307 Jul-05-2019, 02:13 AM
Last Post: Skaperen
  Update value selected in option menu when select an item from text box klllmmm 2 288 Jun-06-2019, 04:51 AM
Last Post: klllmmm
  The PMW Notebook Widget MattSA 6 445 Jun-03-2019, 07:24 PM
Last Post: Larz60+
  [WxPython] how to reopen a closed tab of wx.aui.Notebook? royer14 2 314 Feb-18-2019, 12:31 AM
Last Post: royer14
  [Tkinter] Adding New TAB to NoteBook Widget by Clicking Vicolas 0 298 Feb-15-2019, 06:03 PM
Last Post: Vicolas
  Tkinter Gui Menu Addition Error whisperquiet 2 412 Jan-04-2019, 09:29 PM
Last Post: whisperquiet
  [Tkinter] Notebook accessing a specific tab using a button from a toplevel frame honestie 8 2,958 Sep-12-2018, 01:51 AM
Last Post: honestie
  Dropdown menu- Store variable aking76 1 553 Sep-11-2018, 01:30 PM
Last Post: aking76

Forum Jump:


Users browsing this thread: 1 Guest(s)