Search code examples
pythongtk

Why Gtk.ScrolledWindow doesn't work within Gtk.Frame in Python?


Helo,

I've a Gtk.Box.

Inside the Gtk.Box I've three times Gtk.Frame.

Gtk.ScrolledWindow is within one Gtk.Frame.

In the Gtk.ScrolledWindow is a TreeView.

It looks like this:

    `box = Gtk.Box(spacing=3)
    self.box = box

    # Create two frames
    frame1 = Gtk.Frame()
    frame1.set_margin_right(5)
    frame2 = Gtk.Frame()
    frame3 = Gtk.Frame()

    view = Gtk.TreeView(model=listmodel)

    scrolledwindow = Gtk.ScrolledWindow()
    scrolledwindow.add(view)

    self.frame1.add(srolledwindow)
    self.frame1.show_all()`

So, why there is nothing shown in the first frame, if I start the app? It only show the frame but not the contents (the Treeview ist filled with a model and values, which are not in my example here).

Don't know how to solve it :-(


Solution

  • It looks like you don't add the frames to the box.

    Also frames 2 and 3 seem to be empty.