• Problem with changing the tab position in a ttk::notebook.

    From Donald Rozenberg@21:1/5 to All on Thu Oct 19 00:05:57 2023
    Hi,
    I am working on a GUI generator based on the tk and ttk widget sets and am having a problem with moving the tab position to the bottom edge of a ttk::notebook. It doesn't show the tabs but leaves room for them.

    Consider the code:

    ttk::notebook .nb -width 200 -height 100
    ttk::frame .nb.f1; # first page
    ttk::frame .nb.f2; # second page
    .nb add .nb.f1 -text "One"
    .nb add .nb.f2 -text "Two"
    pack .nb
    button .tn -text "Tabs to North" -command \
    "ttk::style configure TNotebook -tabposition n"
    pack .tn
    button .ts -text "Tabs to South" -command \
    "ttk::style configure TNotebook -tabposition s"
    pack .ts
    button .td -text "Default position" -command \
    "ttk::style configure TNotebook -tabposition \"\""
    pack .td

    When you execute the code you see a ttk::notebook with two tabs in the default position. If you select the "Tabs to North" button the expected behavior
    occurs.

    If you select "Tabs to South" space is created for tabs at the bottom edge but the tabs do not appear.

    If you select the Default position button the tabs go to nw as hoped for.

    What am I doing wrong?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alex P@21:1/5 to All on Thu Oct 19 04:49:13 2023
    The above workaround looks like a silly attempt to fight a bug :(

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alex P@21:1/5 to All on Thu Oct 19 04:41:13 2023
    package require Tk
    proc ::TabOrientation {{pos ""}} {
    lassign [split [wm geometry .] x+] w h x y
    ttk::style configure TNotebook -tabposition $pos
    incr w 1
    wm geometry . ${w}x${h}+${x}+${y}
    update
    incr w -1
    wm geometry . ${w}x${h}+${x}+${y}
    update
    }
    ttk::notebook .nb -width 200 -height 100
    ttk::frame .nb.f1; # first page
    ttk::frame .nb.f2; # second page
    .nb add .nb.f1 -text "One"
    .nb add .nb.f2 -text "Two"
    pack .nb -fill both -expand 1
    button .tn -text "Tabs to North" -command {::TabOrientation n}
    pack .tn
    button .ts -text "Tabs to South" -command {::TabOrientation s}
    pack .ts
    button .td -text "Default position" -command ::TabOrientation
    pack .td

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Francois Vogel@21:1/5 to Donald Rozenberg on Sat Oct 21 23:54:16 2023
    Le 19/10/2023 à 09:05, Donald Rozenberg a écrit :
    I am having a problem with moving the tab position to the bottom edge of a ttk::notebook. It doesn't show the tabs but leaves room for them.

    Thanks for the report and the ticket you have filed.

    Follow-up to:

    https://core.tcl-lang.org/tk/tktview/198376af5a

    I have crafted a fix for this bug.

    Regards,
    Francois

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Sun Oct 22 09:54:05 2023
    Am 21.10.2023 um 23:54 schrieb Francois Vogel:
    Le 19/10/2023 à 09:05, Donald Rozenberg a écrit :
    I am having a problem with moving the tab position to the bottom edge
    of a ttk::notebook. It doesn't show the tabs but leaves room for them.

    Thanks for the report and the ticket you have filed.

    Follow-up to:

        https://core.tcl-lang.org/tk/tktview/198376af5a

    I have crafted a fix for this bug.

    Regards,
    Francois


    Great action, Francois, I appreciate !

    Perhaps, Csaba, the visual magican, may comment on the question about
    visual defects when the labels are left/right.

    Take care,
    Harald

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