From: Harald O. <Har...@El...> - 2009-07-23 08:33:03
|
Hello BWidget community, Koen Danckaert proposes in BWidget patch 2825354 to revert a modification on the tree widget (tree.tcl). Issue: Old (and proposed behaviour) : - there is a vertical line from the top of the widget to the first node ASCII-Arts: +---- <- Tree Widget border | | <- this line is the issue | +--Node 1 | | | +--Node 2 Current behaviour: - this line is not present Login entry to current behaviour: 2004-04-21 Jeff Hobbs <je...@Ac...> * tree.tcl (_draw_subnodes): Adjust the drawing of the line to the first root node to start at the vertical point (not go up). Addiditional explanation by Jeff: The reason I made that change was to be visually compatible with Windows (older style, as new style is no lines) when you actually have sub-nodes (the [+] and [-] indicators). The line to the top is then inconsistent with the way others draw. You could try and make that check contingent on whether subnodes exist, but I think that may seem odd. --- Please write your opinion. Thank you, Harald |
From: Koen D. <ko...@re...> - 2009-07-23 13:28:12
|
Harald Oehlmann wrote: > Hello BWidget community, > > Koen Danckaert proposes in BWidget patch 2825354 to revert a > modification on the tree widget (tree.tcl). > > Issue: > > Old (and proposed behaviour) : > - there is a vertical line from the top of the widget to the first node > ASCII-Arts: > +---- <- Tree Widget border > | | <- this line is the issue > | +--Node 1 > | | > | +--Node 2 > > Current behaviour: > - this line is not present > > Login entry to current behaviour: > > 2004-04-21 Jeff Hobbs <je...@Ac...> > * tree.tcl (_draw_subnodes): Adjust the drawing of the line to the > first root node to start at the vertical point (not go up). > > Addiditional explanation by Jeff: > > The reason I made that change was to be visually compatible with Windows > (older style, as new style is no lines) when you actually have sub-nodes > (the [+] and [-] indicators). The line to the top is then inconsistent > with the way others draw. > You could try and make that check contingent on whether subnodes exist, > but I think that may seem odd. My opinion is: - When the first node has subnodes, it does not really matter. Both styles look good visually. It may be inconsistent with some older Windows style, but as Jeff points out, the new Windows style is to draw no lines at all. So why would we still try to match the older style? - When the first node has no subnodes, it looks strange to have no line. - When there are only 1 or 2 nodes in the tree, it looks even more strange: pack [Tree .t -padx 2] .t insert end root node1 -text "Node 1" .t insert end root node2 -text "Node 2" ;# try with and without this line Of course, you could say that you never want a tree with only 1 node, but in one of our applications we let the user interactively create a tree, and in that case a tree with 1 node may be a necessary intermediate state. Making the line dependent on whether subnodes exist would also be strange: then the line will suddenly (dis)appear when subnodes are created/deleted in such an interactive application. --Koen |
From: Jeff H. <je...@ac...> - 2009-07-23 18:09:30
|
On 23/07/2009 6:10 AM, Koen Danckaert wrote: >> Issue: >> - there is a vertical line from the top of the widget to the first node >> Addiditional explanation by Jeff: >> >> The reason I made that change was to be visually compatible with Windows >> (older style, as new style is no lines) when you actually have sub-nodes >> (the [+] and [-] indicators). The line to the top is then inconsistent >> with the way others draw. >> You could try and make that check contingent on whether subnodes exist, >> but I think that may seem odd. > > My opinion is: > > - When the first node has subnodes, it does not really matter. Both > styles look good visually. It may be inconsistent with some older > Windows style, but as Jeff points out, the new Windows style is to > draw no lines at all. So why would we still try to match the older > style? I actually disagree on this point. With subnodes it actually does look odd to anchor right to the top. > - When the first node has no subnodes, it looks strange to have no line. > - When there are only 1 or 2 nodes in the tree, it looks even more strange: > > pack [Tree .t -padx 2] > .t insert end root node1 -text "Node 1" > .t insert end root node2 -text "Node 2" ;# try with and without this line > > Of course, you could say that you never want a tree with only 1 node, > but in one of our applications we let the user interactively create a > tree, and in that case a tree with 1 node may be a necessary > intermediate state. > > Making the line dependent on whether subnodes exist would also be > strange: then the line will suddenly (dis)appear when subnodes are > created/deleted in such an interactive application. At first I was ambivalent, but I dug up an app where BWidget was still used that I wrote (GUI Builder, at http://spectcl.sourceforge.net). In it you will find a few use cases that in review I prefer the current (no top anchor line) behavior. You can find pictures of the various tabs at: http://docs.activestate.com/komodo/3.5/komodo-doc-guibuilder.html#guibuilder_top In there, you will see that the node to the top is actually drawn, and in the one in sources (with newer BWidget), it isn't. I actually prefer the newer lack of top anchor look, and it does have the single node case to start. I think this also applies to how the tree is used. When it has the classic single root node, it is better without the top anchor line displayed, but I could see it as ok with multiple root nodes. In the end, this can simply be made an option, like -showrootanchor or something. Jeff |
From: Koen D. <ko...@re...> - 2009-07-24 13:43:45
|
Jeff Hobbs wrote: > In there, you will see that the node to the top is actually drawn, and > in the one in sources (with newer BWidget), it isn't. I actually prefer > the newer lack of top anchor look, and it does have the single node case > to start. I think this also applies to how the tree is used. When it > has the classic single root node, it is better without the top anchor > line displayed, but I could see it as ok with multiple root nodes. > > In the end, this can simply be made an option, like -showrootanchor or > something. Ok, I already thought that the Windows style you were referring to always had exactly one top node, which is not the case for BWidget (where the real "root" node is actually invisible). I propose to make the line dependent on whether there are multiple top nodes. (Harald, the patch for that is below.) It seems we could agree on that, and I prefer it to an extra option (= extra documentation, which will probably difficult to understand without trying out.) --Koen Index: tree.tcl =================================================================== RCS file: /cvsroot/tcllib/bwidget/tree.tcl,v retrieving revision 1.59 diff -b -u -r1.59 tree.tcl --- tree.tcl 30 Jun 2009 16:17:37 -0000 1.59 +++ tree.tcl 24 Jul 2009 13:26:22 -0000 @@ -1369,12 +1369,9 @@ set yp $y1 set y1 [_draw_node $path $node $x0 [expr {$y1+$deltay}] $deltax $deltay $padx $showlines] } - if { $showlines && [llength $nodes] } { - if {$y0 < 0} { - # Adjust the drawing of the line to the first root node - # to start at the vertical point (not go up). - incr y0 $deltay - } + # Only draw a line to the virtual root node when there are multiple top nodes. + set len [llength $nodes] + if { $showlines && $len && !($y0 < 0 && $len < 2) } { set id [$path.c create line $x0 $y0 $x0 [expr {$yp+$deltay}] \ -fill [Widget::getoption $path -linesfill] \ -stipple [Widget::getoption $path -linestipple] \ |
From: Jeff H. <je...@ac...> - 2009-07-24 15:29:55
|
Agreed. On 24/07/2009 6:30 AM, Koen Danckaert wrote: > Jeff Hobbs wrote: >> In there, you will see that the node to the top is actually drawn, and >> in the one in sources (with newer BWidget), it isn't. I actually >> prefer the newer lack of top anchor look, and it does have the single >> node case to start. I think this also applies to how the tree is >> used. When it has the classic single root node, it is better without >> the top anchor line displayed, but I could see it as ok with multiple >> root nodes. >> >> In the end, this can simply be made an option, like -showrootanchor or >> something. > > Ok, I already thought that the Windows style you were referring to > always had exactly one top node, which is not the case for BWidget > (where the real "root" node is actually invisible). > > I propose to make the line dependent on whether there are multiple top > nodes. (Harald, the patch for that is below.) It seems we could agree on > that, and I prefer it to an extra option (= extra documentation, which > will probably difficult to understand without trying out.) > > --Koen > > > Index: tree.tcl > =================================================================== > RCS file: /cvsroot/tcllib/bwidget/tree.tcl,v > retrieving revision 1.59 > diff -b -u -r1.59 tree.tcl > --- tree.tcl 30 Jun 2009 16:17:37 -0000 1.59 > +++ tree.tcl 24 Jul 2009 13:26:22 -0000 > @@ -1369,12 +1369,9 @@ > set yp $y1 > set y1 [_draw_node $path $node $x0 [expr {$y1+$deltay}] $deltax > $deltay $padx $showlines] > } > - if { $showlines && [llength $nodes] } { > - if {$y0 < 0} { > - # Adjust the drawing of the line to the first root node > - # to start at the vertical point (not go up). > - incr y0 $deltay > - } > + # Only draw a line to the virtual root node when there are multiple > top nodes. > + set len [llength $nodes] > + if { $showlines && $len && !($y0 < 0 && $len < 2) } { > set id [$path.c create line $x0 $y0 $x0 [expr {$yp+$deltay}] \ > -fill [Widget::getoption $path -linesfill] \ > -stipple [Widget::getoption $path -linestipple] \ > |