• ttk::panedwindow possible enhancements

    From Harald Oehlmann@wortkarg3@yahoo.com to comp.lang.tcl on Fri Jan 24 11:56:25 2025
    From Newsgroup: comp.lang.tcl

    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

    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Ashok@apnmbx-public@yahoo.com to comp.lang.tcl on Sat Jan 25 20:43:19 2025
    From Newsgroup: comp.lang.tcl

    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


    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Harald Oehlmann@wortkarg3@yahoo.com to comp.lang.tcl on Sun Jan 26 13:25:47 2025
    From Newsgroup: comp.lang.tcl

    Hi Ashok,
    thank you, great. Yes, I am aware of this.
    Nevertheless, I would love to have this solved in general, e.g. always
    having a sash graphic.

    Thanks,
    Harald

    Am 25.01.2025 um 16:13 schrieb Ashok:
    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



    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Emiliano@emiliano@example.invalid to comp.lang.tcl on Mon Jan 27 22:08:53 2025
    From Newsgroup: comp.lang.tcl

    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.

    Best regards.
    --
    Emiliano
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Harald Oehlmann@wortkarg3@yahoo.com to comp.lang.tcl on Thu Jan 30 09:18:54 2025
    From Newsgroup: comp.lang.tcl

    Am 28.01.2025 um 02:08 schrieb Emiliano:
    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.

    Dear Emiliano,
    thanks for the message, that is great!
    IMHO it would be great to have a sash graphics by default for all themes.
    And yes, a possibility to put buttons on the sash would also be great.
    I am aware that all behaviour can be changed by internal bindings etc,
    but nothing is documented and an official interface for those points may
    be great.
    I can also imaging scrollwheel bindings on the sash, like "collapse
    up/down".

    Thanks for all,
    Harald

    --- Synchronet 3.20c-Linux NewsLink 1.2