python 3.x - How do Gtk.ScrolledWindow() work? What are the rules/good practices? -
i'm trying display gtk.treeview()
in gtk.messagedialog()
, this:
box = dialog.get_message_area() box.add(treeview)
and works:
but it's tall dialog window. you'd think treeview widget take care of own size allocation , scrollbars, ok:
scrolledwindow = gtk.scrolledwindow() scrolledwindow.set_policy(gtk.policytype.never, gtk.policytype.automatic) scrolledwindow.add_with_viewport(treeview) box.add(scrolledwindow)
but apparently not right way it:
no errors, nothing. , empty dialog. driving me crazy. i'm getting sense want impossible/discouraged, can't find relevant information on that. mean, maybe it's not gtk.messagedialog()
have use? can't find relevant info that. i want display tabular data in popup window, why hard, it's been 2 days now..? guidance, i'm lost here.
ok, found solution (thank much) in an archived mail somewhere. yes, can put treeview in scrolled_window. solution use
scrolledwindow.set_size_request(x, y)
because otherwise scrolled window 1px high..?! is not documented. this page supposed introduce gtk3+ containers, code examples. doesn't gtk.scrolledwindow()
documentation scattered all over the place. oh well, day gone click-click-click, hope message can somebody.
Comments
Post a Comment