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:

tall dialog

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:

empty dialog

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

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -