Dear Tk experts,
please allow me to ask for opinions on the ttk::panedwindow widget.
IMHO it may get some love.
My main challenges:
1) in vista theme, the Sash is invisible. There is just a 3 pixel width
line which changes the cursor, if the mouse hoovers over it.
Users may easily overlook it, specially, if the sash is at position 0 or adjacent to another sash.
2) if there is a resize by sash drop, I want to get a callback to save
the sash position for later restoring.
3) if there is a sash drag, I want to control the valid values. For
example, always make a part of the window visible (like a tablelist
title row).
4) I would love to attach additional functionality to the sash, like
right click->menu or double-left-click->zoom.
I suppose, 2-4 may be solved by exposing the widget name of the sash.
For point 1, I hope magic Csaba may look into it.
There are partly solutions on the wiki page, which bind for point 2 and
3 on Button 1 down on the widget. For me, this is more a work-around
than a solution.
Thanks for all !
Harald
Harald,
You mentioned the Wiki. For (1), did you look at the "Create a Custom
Sash Handle bar" section at https://wiki.tcl-lang.org/page/ ttk%3A%3Apanedwindow as well as https://wiki.tcl-lang.org/page/ Custom+sash+handle+for+panedwindow ?
/Ashok
On 1/24/2025 4:26 PM, Harald Oehlmann wrote:
Dear Tk experts,
please allow me to ask for opinions on the ttk::panedwindow widget.
IMHO it may get some love.
My main challenges:
1) in vista theme, the Sash is invisible. There is just a 3 pixel
width line which changes the cursor, if the mouse hoovers over it.
Users may easily overlook it, specially, if the sash is at position 0
or adjacent to another sash.
2) if there is a resize by sash drop, I want to get a callback to save
the sash position for later restoring.
3) if there is a sash drag, I want to control the valid values. For
example, always make a part of the window visible (like a tablelist
title row).
4) I would love to attach additional functionality to the sash, like
right click->menu or double-left-click->zoom.
I suppose, 2-4 may be solved by exposing the widget name of the sash.
For point 1, I hope magic Csaba may look into it.
There are partly solutions on the wiki page, which bind for point 2
and 3 on Button 1 down on the widget. For me, this is more a work-
around than a solution.
Thanks for all !
Harald
Dear Tk experts,
please allow me to ask for opinions on the ttk::panedwindow widget.
IMHO it may get some love.
My main challenges:
1) in vista theme, the Sash is invisible. There is just a 3 pixel width
line which changes the cursor, if the mouse hoovers over it.
Users may easily overlook it, specially, if the sash is at position 0 or adjacent to another sash.
2) if there is a resize by sash drop, I want to get a callback to save
the sash position for later restoring.
3) if there is a sash drag, I want to control the valid values. For
example, always make a part of the window visible (like a tablelist
title row).
4) I would love to attach additional functionality to the sash, like
right click->menu or double-left-click->zoom.
I suppose, 2-4 may be solved by exposing the widget name of the sash.
For point 1, I hope magic Csaba may look into it.
On Fri, 24 Jan 2025 11:56:25 +0100
Harald Oehlmann <wortkarg3@yahoo.com> wrote:
Dear Tk experts,
please allow me to ask for opinions on the ttk::panedwindow widget.
IMHO it may get some love.
My main challenges:
1) in vista theme, the Sash is invisible. There is just a 3 pixel width
line which changes the cursor, if the mouse hoovers over it.
Users may easily overlook it, specially, if the sash is at position 0 or
adjacent to another sash.
Dear Harald:
I don't know about native themes (win and macos), but I can get a grip
on the default themes on X11 with the following code:
image create photo ::ttk::defaultvgrip -data {
iVBORw0KGgoAAAANSUhEUgAAAAUAAAAbCAYAAAC0s0UOAAAABmJLR0QA/wD/AP+gvaeTAAAA
CXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH6QEbFwcqynTzIAAAAKNJREFUKM/ljzEKwkAQ
Rd/OBlwLJWBnIShqioCNp7D0CF7Q0oMIFltEECFWU1gZMGssDAYkFtb+dt6fxzeqymcigMFw
mCCSEqzXy+kgr5udUJkVNiRvEkLGQ3YQPIBp+ym0pSb7ODcijmNVrUnXW4BsKIplUy/vBoio
rDT2srsnup1xnetv9nrmeArlHEKmee5rspxhWCOS/uFMT2W3VNHxq+gJ3RFb4/EnHL0AAAAA
SUVORK5CYII=
}
image create photo ::ttk::defaulthgrip -data {
iVBORw0KGgoAAAANSUhEUgAAABsAAAAFCAYAAAC0CJe+AAAABmJLR0QA/wD/AP+gvaeTAAAA
CXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH6QEbFxAG/S8bVQAAAJtJREFUKM+90T0OgkAQ
huF3fwzbqaGjVAMFiZcw8QBe1t4j2BEVu+2mEAsoWLDQrDUNU06e5JsfJSLMVRYgzbINmALs
TfzzDpCmuyW23WMXI937KiLNz+ZgttNsqMX7Sn8zTYHiBH0ex3DtGquPEA44t4r9UZeTrdZl
3AxMjerPjMMjwiR50fUXVBhwrvkfI1QooybZYCoANefPPoUQTj/QmFn/AAAAAElFTkSuQmCC }
ttk::style theme settings default {
ttk::style element create Sash.vgrip image ::ttk::defaultvgrip
ttk::style element create Sash.hgrip image ::ttk::defaulthgrip
ttk::style layout Vertical.Sash {
Sash.vsash -sticky nswe -children {
Sash.vgrip -sticky {}
}
}
ttk::style layout Horizontal.Sash {
Sash.hsash -sticky nswe -children {
Sash.hgrip -sticky {}
}
}
}
ttk::style theme settings classic {
ttk::style layout Vertical.Sash {Sash.vsash -sticky ns}
ttk::style layout Horizontal.Sash {Sash.hsash -sticky we}
}
For better scaling, svg grip images can be used.
2) if there is a resize by sash drop, I want to get a callback to save
the sash position for later restoring.
3) if there is a sash drag, I want to control the valid values. For
example, always make a part of the window visible (like a tablelist
title row).
4) I would love to attach additional functionality to the sash, like
right click->menu or double-left-click->zoom.
I suppose, 2-4 may be solved by exposing the widget name of the sash.
For point 1, I hope magic Csaba may look into it.
All this behaviour is scripted, and it can be changed easily. See the
procs in ::ttk::panedwindow namespace, specially Press (bound to <Button-1>), Drag (<Button1-Motion>), Release (ButtonRelease-1) and SetCursor (<Motion>). For points 2) and possibly 3), a virtual event can be used. For point 4), just
use [bind].
While we are here, I want just another possibility: collapsible panedwindows. For an idea of what I'm talking about, see the panedwindow handle of Libreoffice's docked Navigator at https://wiki.documentfoundation.org/images/thumb/3/33/202202EN_Navigator_01_edited.png/300px-202202EN_Navigator_01_edited.png
at the left of Hyperlinks. If dragged, it behaves as a standard panedwindow. But if single clicked, it collapses to the right, hiding the Navigator.
It also changes the direction of the arrow from right to left.
Just food for thought.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,028 |
Nodes: | 10 (1 / 9) |
Uptime: | 125:17:50 |
Calls: | 13,329 |
Calls today: | 1 |
Files: | 186,574 |
D/L today: |
369 files (85,914K bytes) |
Messages: | 3,355,124 |