[pygtk] synchronizing HPaned widgets

Stephen Langer stephen.langer at nist.gov
Fri Feb 6 07:39:17 WST 2009


On Feb 5, 2009, at 5:24 PM, John Finlay wrote:

> Yes but you have to set the default size of the window as large or  
> larger than the required size of the largest pane. Your code doesn't  
> set the window size so it starts up with the minimum required size  
> to fit the paned widgets. Since the two separators can't line up  
> because the panes are different sizes and because the panes can't  
> shrink the set_position() calls fail and apparently trigger a resize  
> calculation which trys to set the position and so on. Your choices  
> are allow something to shrink or set a window size that will allow  
> the separators to line up initially.

Ok, I see now.  The minimum size for each pane is smaller than the  
minimum size that will hold the aligned panes, but the window asks the  
panes for their minimum sizes before they've tried to align themselves.

> Also you can add a detail to the "notify" signal connection that  
> only signals when the position is changed - use "notify::position"  
> and you can remove the gparamspec.name check in paneMoved().

Thanks for pointing that out.

  -- Steve

--
-- EMail: stephen.langer at nist.gov                    Phone: (301)  
975-5423 --
-- WWW:  http://math.nist.gov/mcsd/Staff/SLanger/    Fax:   (301)  
975-3553 --
-- Mail: NIST; 100 Bureau Drive -- Stop 8910; Gaithersburg, Md   
20899-8910 --

-- "I don't think this will work.  That's why it's  
science."               --
--                              Naomi Langer (age 6),  17 Feb  
2003         --




More information about the pygtk mailing list