By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,285 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,285 IT Pros & Developers. It's quick & easy.

Pygtk, treeview problem in the layout

micmast
100+
P: 144
Ey all,

I'm currently working on an application that uses the pygtk libraries to create windows and widgets. I have a HBOX (2 boxes) in the middle and in the left one I have a treeview, in the right the rest (drawingarea, entries, labels, notebooks, ...). But, as usual, the big hbox is divided exactly in the middle and I was wondering if it is possible to make sure that the left hbox doesn't use more then an amount of pixels. I tried looking at the treeview column to limit the width, with no result. I tried settings the width of the hbox, no result.
I tried creating a layout and put my treeview widget on that, with a fixed height & width, also no result...

So I just don't know anymore, any help would be nice.

Thx in advance
Dec 8 '08 #1
Share this Question
Share on Google+
1 Reply


micmast
100+
P: 144
ey all,

I found a possible solution, and I figured I might share it with the rest, somebody might need it in the future.

Expand|Select|Wrap|Line Numbers
  1. ...
  2. self.screen_with = gtk.gdk.screen_width()
  3. self.treeview = gtk.TreeView(self.treestore)
  4. self.treecolumn = gtk.TreeViewColumn("Assets")
  5. self.treecolumn.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
  6. self.treecolumn.set_resizable(True)
  7. self.treecolumn.set_fixed_width(self.screen_width / 5)
  8. self.treeview.append_column(self.treecolumn)
  9. ...
  10.  
Afterwards I add the treeview to a hbox, and now the width is fixed, but when I maximize the application, the treeview failes to update the screen. This might be a windows bug, but could also be a problem in general... If somebody has any ideas, fire away :)
Dec 9 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.