• Announce: znotebook 1.0

    From [email protected]@21:1/5 to All on Sun Oct 1 15:29:16 2023
    znotebook is an extension of the standard [ttk::notebook] widget.

    See at https://wiki.tcl.tk/znotebook
    ==============================

    All ttk::notebook's options and commands are supported.
    znotebook comes with 5 new options for controlling its new interactive features.

    * All znotebooks' tabs can be interactively rearranged (Click and drag).
    If a tab is dragged outside the tabs-area, it becomes a "detached tab", i.e. a new toplevel window.
    Detached.tabs have a small special button (rejoin-button) to bring it back to the notebook.

    * All znotebook's tabs have a small [x] button for destroying the tab.
    New options (-preclosetab and -postclosetab) can be used to control which tabs can be removed
    and for doing some cleanup after the tab has been (interactively) removed.

    * Znotebook provides a default [+] button (wholly programmable) for adding new tabs.

    * Znotebook tabs can be renamed interactively.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alex P@21:1/5 to All on Wed Oct 4 04:29:32 2023
    Hi Aldo,

    I use something similar to your znotebook, I'd like to share my experience of dealing with such widget type.

    Would you consider introducing a context menu for znotebook's tabs? At that customizable by the user? This feature greatly enhances a user's possibilities to handle znotebook's tabs.

    I propose including "static" menu items (provided by you, like add/delete/rename/close...) and "dynamic" items (added optionally by a user), separated by a separator.

    The context menu could make "+" button of znotebook unnecessary. Another reasons: "+" button looks alike to "x" and it takes a space of the tab bar.

    Also, I'd noted that your wiki page's text is rendered as Tcl code, which is probably not that you had in mind.

    Thank you for your work.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Thu Oct 5 13:05:13 2023
    Hi Alex,
    adding a context menu is easy

    bind .mynb <ButtonPress-3> {
    set tabIdx [%W index @%x,%y]
    ... with tabIdx you can get everything about the tab (text label, or the attached window...)
    .. open a popup menu at %X %Y ...
    }
    or
    bind Z.Tnotebook <ButtonPress-3> {...}
    if you want a popup for all your znotebook instances..

    but honestly, I don't see a reason for a popup menu ; operations like move, rename, delete can already be activated with a simple click ...

    Anyway, I'm interested: Have you a use-case for other 'general-purpose' operations on a tab ?

    About the add-button [+] you can hide it if you don't want it
    .mynb configure -showaddbutton false
    ( and then if you want to remove the unoccupied space at left you should do a little trick with ttk::style ...)
    .. Uhm .. this may be a small enhancement .. when the add-button is hidden the unoccupied space at left should be automatically resized..

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alex P@21:1/5 to All on Fri Oct 6 23:02:26 2023
    Hi Aldo,

    Anyway, I'm interested: Have you a use-case for other 'general-purpose' operations on a tab ?

    These operations are directly offered by the znotebook's dynamic nature, here few to list:

    - "Open tab in new window" / "Detach the tab"

    - "Close all tabs" (leaving only "empty/default" one)

    - "Close all detached tabs"

    As for the user's operations, these may be:

    - "Lock / Unlock" (means 'Not closed / Not modified' etc.)

    - "Sort" (by names / dates etc. depending on the app's requirements)

    - "Mark / Unmark" (these may replace "X" button with an icon when a tab not mouse hovered)

    I don't know details of znotebook, but it would be nice to have a possibility to mark the tabs' labels not only with icons but also with -fg / -bg.

    Also, I'd consider some other possibilities:

    - to have configure/cget methods for tabs

    - to have IDs for tabs (as labels cannot identify them, esp. when they are duplicate)

    - to have an option "to allow duplicates or not" (it's can be rather fussy for a user to distinguish the duplicates) or an option "to supply duplicates with #count"

    - to have an option "cut the long labels by a maximum length" (as the znotebook tabs are dynamic, they can generally have long labels, so to have "Label so long..." would be better than "Label so long, so long ... so long"

    - to have tooltips, esp. for the previous "long length" option

    Well, it seems like znotebook is at the very beginning of development, so at your creativity it will acquire a lot of new facilities. As znotebook looks pretty promising. And it's all absolutely in your hands to enhance it.

    It's clear that the more Tcl/Tk high quality widgets exist the better. The last Tcl activities for documentation/manuals and package/app management are only confirming this.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to [email protected] on Sun Oct 8 14:26:37 2023
    On 10/1/2023 3:29 PM, [email protected] wrote:
    znotebook is an extension of the standard [ttk::notebook] widget.

    See at https://wiki.tcl.tk/znotebook
    ==============================

    All ttk::notebook's options and commands are supported.
    znotebook comes with 5 new options for controlling its new interactive features.

    * All znotebooks' tabs can be interactively rearranged (Click and drag).
    If a tab is dragged outside the tabs-area, it becomes a "detached tab", i.e. a new toplevel window.
    Detached.tabs have a small special button (rejoin-button) to bring it back to the notebook.

    * All znotebook's tabs have a small [x] button for destroying the tab.
    New options (-preclosetab and -postclosetab) can be used to control which tabs can be removed
    and for doing some cleanup after the tab has been (interactively) removed.

    * Znotebook provides a default [+] button (wholly programmable) for adding new tabs.

    * Znotebook tabs can be renamed interactively.

    Hi Aldo:

    Nice package. znotebook provides for tcl/tk a great megawidget without all the work of building one.

    I think Alex's suggestion of context menus could be included in znotebook to make it even easier than doing the binding code yourself. For example, suppose we had:

    .nb add [frame .f1 -bg red] -text RED -menu \
    [list {open... openproc} {save... saveproc} separator {settings... settingsproc -font xyz}]

    Where znotebook could build a context popup menu using the right mouse button and having 3 menu items with a separator after the first 2. The user could still do their own binding for more complex menus, but for a quicky, a -menu option would be handy.

    You mentioned in the readme that you might include scrolling. That is why I still use the BWidgets NoteBook. However, it renders tiny difficult to use arrows on either end of the tabs container (a canvas).

    So I bind to the mousewheel (it's buttons 4,5 on linux) to activate tabs to the left or right and calling the "see" method which then scrolls if necessary to make the tab visible. Scrolling also has the advantage that it doesn't squeeze out characters
    from the tab labels as znotebook currently does when adding more tabs (at least in the demo).

    If you do implement scrolling, you might consider providing mousewheel support. It works quite nicely when a mousewheel has detents with discrete steps.

    I like what you've created. Please consider the above suggestions. You can see a demo of scrolling and context menus done in Bwidgets in https://wiki.tcl-lang.org/page/notebook (the last code block on that page which can be pasted into a windows console -
    it does require BWidget 1.9.13 or later).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexandru@21:1/5 to [email protected] on Tue Oct 10 19:17:27 2023
    [email protected] schrieb am Montag, 2. Oktober 2023 um 00:29:20 UTC+2:
    znotebook is an extension of the standard [ttk::notebook] widget.

    See at https://wiki.tcl.tk/znotebook
    ==============================

    All ttk::notebook's options and commands are supported.
    znotebook comes with 5 new options for controlling its new interactive features.

    * All znotebooks' tabs can be interactively rearranged (Click and drag).
    If a tab is dragged outside the tabs-area, it becomes a "detached tab", i.e. a new toplevel window.
    Detached.tabs have a small special button (rejoin-button) to bring it back to the notebook.

    * All znotebook's tabs have a small [x] button for destroying the tab.
    New options (-preclosetab and -postclosetab) can be used to control which tabs can be removed
    and for doing some cleanup after the tab has been (interactively) removed.

    * Znotebook provides a default [+] button (wholly programmable) for adding new tabs.

    * Znotebook tabs can be renamed interactively.

    Are there any restrictions to your package?
    I tested it within my software and it's not working.
    The tabs cannot be detached.
    I do have some callbacks defined:
    bind $notebook <<NotebookTabChanged>> {after idle TabChanged}
    bind $notebook <<CloseTabRequested>> [list TabCloseCallback $notebook %d]
    Can this cause the issue?

    Regards
    Alex

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to Alexandru on Wed Oct 11 11:07:23 2023
    On 10/10/2023 7:17 PM, Alexandru wrote:
    [email protected] schrieb am Montag, 2. Oktober 2023 um 00:29:20 UTC+2:
    znotebook is an extension of the standard [ttk::notebook] widget.

    See at https://wiki.tcl.tk/znotebook
    ==============================

    All ttk::notebook's options and commands are supported.
    znotebook comes with 5 new options for controlling its new interactive features.

    * All znotebooks' tabs can be interactively rearranged (Click and drag).
    If a tab is dragged outside the tabs-area, it becomes a "detached tab", i.e. a new toplevel window.
    Detached.tabs have a small special button (rejoin-button) to bring it back to the notebook.

    * All znotebook's tabs have a small [x] button for destroying the tab.
    New options (-preclosetab and -postclosetab) can be used to control which tabs can be removed
    and for doing some cleanup after the tab has been (interactively) removed. >>
    * Znotebook provides a default [+] button (wholly programmable) for adding new tabs.

    * Znotebook tabs can be renamed interactively.

    Are there any restrictions to your package?
    I tested it within my software and it's not working.
    The tabs cannot be detached.
    I do have some callbacks defined:
    bind $notebook <<NotebookTabChanged>> {after idle TabChanged}
    bind $notebook <<CloseTabRequested>> [list TabCloseCallback $notebook %d] Can this cause the issue?

    Regards
    Alex

    Check out the readme.txt, only frame containers can be detached.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Wed Oct 11 16:39:53 2023
    Il giorno mercoledì 11 ottobre 2023 alle 20:07:29 UTC+2 et99 ha scritto:
    On 10/10/2023 7:17 PM, Alexandru wrote:
    [email protected] schrieb am Montag, 2. Oktober 2023 um 00:29:20 UTC+2:
    znotebook is an extension of the standard [ttk::notebook] widget.

    See at https://wiki.tcl.tk/znotebook
    ==============================

    All ttk::notebook's options and commands are supported.
    znotebook comes with 5 new options for controlling its new interactive features.

    * All znotebooks' tabs can be interactively rearranged (Click and drag). >> If a tab is dragged outside the tabs-area, it becomes a "detached tab", i.e. a new toplevel window.
    Detached.tabs have a small special button (rejoin-button) to bring it back to the notebook.

    * All znotebook's tabs have a small [x] button for destroying the tab.
    New options (-preclosetab and -postclosetab) can be used to control which tabs can be removed
    and for doing some cleanup after the tab has been (interactively) removed.

    * Znotebook provides a default [+] button (wholly programmable) for adding new tabs.

    * Znotebook tabs can be renamed interactively.

    Are there any restrictions to your package?
    I tested it within my software and it's not working.
    The tabs cannot be detached.
    I do have some callbacks defined:
    bind $notebook <<NotebookTabChanged>> {after idle TabChanged}
    bind $notebook <<CloseTabRequested>> [list TabCloseCallback $notebook %d] Can this cause the issue?

    Regards
    Alex
    Check out the readme.txt, only frame containers can be detached.

    @Alexandru: I hope the hint of et99 could have solved your problem. If not, send me a little, minimal script.

    I wish to thank everybody for all the suggestions for the next improvements. They are a lot !
    So I should decide which of these requests are useful and general-purpose and which requests are against znotebook's design principles.
    Soon I will open a new page on wiki.tcl.tk collecting some tweaks and tricks, the current limitations, as well as some of your improvement proposal, I'd like to discuss together.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)