|
From: Brian G. <bgr...@mo...> - 2005-03-14 17:17:16
|
Joe English wrote: >Just checked in a new paned window widget, ttk::paned. >Documentation here: > > <URL: http://tktable.sourceforge.net/tile/doc/paned.html > > >The API is designed to match the ttk::notebook widget. >Basic usage is similar to the core panedwindow and the BWidget >PanedWindow, but there are a few differences in the details. > >~ Differences from the core panedwindow: > > + Each pane has a -weight option, which is an integer value specifying > the relative amount to shrink or expand the pane when the > overall widget is resized. This is more flexible and, to me, > more intuitive, than '-stretch {first|last|never|always}' > as in the Tk 8.5 panedwindow. > > My experience has been that paned views, where there are more than one pane that was not fixed, the panes would grow or shrink proportional to their initial size when the window was resized. You can't get this behavior with -weight. It's a subtle difference. On the other hand, weight has never been intuitive to me because it's non-linear. Maybe if it was a real number it would make more sense. > + There is no -opaqueresize option; opaque resize is always enabled. > As long as performance is not an issue (which it doesn't appear > to be), this is better usability-wise than deferred resize. > > This _is_ important when working with slow devices, say VNC over a slow or congested network. Window managers still support this kind of option, I think for the same reason. There may not be slow machines any more, but networks are still slow for a lot of reasons. This is something the application user needs control over since the application author cannot predict what the operating environment will look like. Also, you cannot predict the complexity of the panes contents. It may be that a redraw takes seconds rather than msec., so you need to give the application authors this control. Note that the Tk panedwindow has both <Button-1> and <Button-2> bindings for sash motion so that the user has a choice of opaque or not. > + Instead of separate 'paneconfigure' and 'panecget' methods, > the 'pane' method is a generalized accessor like the > ttk::notebook and ttk::treeview widgets use. > > I like this notion, but it does not match the core Tk paradigm. This makes teaching Tcl/Tk a bit more complicated, unless we go back and retrofit all Tk widgets adding "item configure" and "item cget", etc. > + Panes do not have '-before' or '-after' options. Instead, > you can use the [$pw insert] method to specify the initial > position or move an existing pane to a new position. > (See below for rationale). > > Yea! I've never liked the -before & -after as configure options since their values are meaningless once the operation is complete. > >A couple open questions: > >~ Shoving sashes: > >In the 8.4 panedwindow, if there are three or more panes and >the user attempts to drag a sash over an adjacent one, the >adjacent sash gets "shoved" up or down to make room. > >This seemed like a neat idea to me, and that's what I initially >implemented, but after playing with it some I'm not so sure anymore. >It's too easy to "overshoot" when dragging a sash, and end up >shrinking a pane that you didn't intend to shrink. It feels >better to me if sash movement is bounded by the adjacent sashes. >Then again, I'm extraordinarily clumsy with a mouse so this >could just be me. > >You can try it out both ways (change the SHOVE_SASHES #define >in paned.c); let me know what you think. > > I think this depends on the application. This should be configurable when used. >~ Default -weight. > >I'm not sure if the default -weight should be 0 or 1. > >If all panes have -weight 0, then the last pane stretches >or shrinks to make up the difference when the widget is resized. >This is the same as the 8.4 behavior [*], and is the Right Thing >more often than not. On the other hand, sometimes it's the Wrong >Thing entirely (a good bad example is tkchat with the "Users Online" >pane visible -- here you want the _first_ pane to shrink and stretch >while the last one stays fixed size). > >If all panes have -weight 1, OTOH, each pane stretches and shrinks >equally. While this is never completely wrong, it's almost >never exactly right either. > >Since it's easy enough for the program to specify appropriate >weights, this isn't a huge issue. > >[*] Except that the ttk::paned window handles conditions >where the last pane(s) are completely shrunk better. > > As you point out, a default of 1 is almost never right, therefore, I would go with "-stretch last". :-) > >~ Stuff that might get added later: > > + "collapse buttons" on sashes, like in the Mozilla sidebar > > I was contemplating adding this to the Tk panedwindow. It should also be possible to bind a menu and balloon help to the sash. > + Active / pressed feedback for sashes > + Ugly sash separators with a square handle in the classic theme > >Stuff that was considered and rejected: > > + -minsize and -maxsize pane options. > + proportional resize of all panes when a sash is dragged > > >Anyway, please try it out and pound on it to shake out the bugs. >(Stuff to look for: horizontal vs. vertical botches, inappropriate >behavior when there are no panes, geometry propagation glitches.) > > >--Joe English > > jen...@fl... > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >_______________________________________________ >Tktable-tile-dev mailing list >Tkt...@li... >https://lists.sourceforge.net/lists/listinfo/tktable-tile-dev > > > -- ------------------------------------------------------------- -- Mentor Graphics Corp. -- -- 8005 SW Boeckman Road 503.685.7000 tel -- -- Wilsonville, OR 97070 USA 503.685.0921 fax -- ------------------------------------------------------------- -- Technical support ............ mailto:su...@mo... -- -- Sales and marketing info ....... mailto:sa...@mo... -- -- Licensing .................... mailto:li...@mo... -- -- Home Page ........................ http://www.model.com -- ------------------------------------------------------------- |