• no indicator box in menus

    From et4@21:1/5 to All on Thu Oct 27 17:01:13 2022
    Below is a modified example script from the manual on [tk_popup] where I added 2 checkbuttons and 2 radiobuttons. I'm not seeing what the manual describes under the [menu ]command. Are tk_popup's different some how? Or is there something I'm missing to
    get it to display the "box".

    Manual:

    "An indicator box is displayed to the left of the label in a checkbutton entry. If the entry is selected then the indicator's center is displayed in the color given by the -selectcolor option for the entry; otherwise the indicator's center is displayed
    in the background color for the menu."

    The problem is that it's not possible to tell from the menu items which are checkboxes or radiobuttons and which are commands, except when the item is selected since there is no "box" as the manual says. Usually one would see a box around a checkmark, or
    an empty box.

    Here is what I see on my pop-os linux, but similar on windows:

    https://postimg.cc/LnXh5BDC

    # Create a menu
    set m [menu .popupMenu]
    $m add command -label "Example 1"
    $m add command -label "Example 2"
    $m add checkbutton -label "Example 3a" -selectcolor red
    $m add checkbutton -label "Example 3b" -selectcolor red
    $m add radiobutton -label "Example 4" -variable radio -selectcolor red
    $m add radiobutton -label "Example 5" -variable radio -selectcolor red
    $m add command -label "Example 6"

    # Create something to attach it to
    pack [label .l -text "Click me!"]

    # Arrange for the menu to pop up when the label is clicked
    bind .l <1> {tk_popup .popupMenu %X %Y}

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Fri Oct 28 12:29:37 2022
    Am 28.10.2022 um 02:01 schrieb et4:
    Below is a modified example script from the manual on [tk_popup] where I added 2 checkbuttons and 2 radiobuttons. I'm not seeing what the manual describes under the [menu ]command. Are tk_popup's different some how?
    Or is there something I'm missing to get it to display the "box".

    Manual:

    "An indicator box is displayed to the left of the label in a checkbutton entry. If the entry is selected then the indicator's center is displayed
    in the color given by the -selectcolor option for the entry; otherwise
    the indicator's center is displayed in the background color for the menu."

    The problem is that it's not possible to tell from the menu items which
    are checkboxes or radiobuttons and which are commands, except when the
    item is selected since there is no "box" as the manual says. Usually one would see a box around a checkmark, or an empty box.

    I fear, your observation is intended behaviour.
    On Windows, native menus are used and that's the way, it is done on
    Windows usually.
    To mark a group of radio buttons, you can:
    - initialize the variable, so one is checked at the beginning.
    - add separator lines to group the radio-button region
    - or put the radio-buttons into a sub-menu.

    Thank you and take care,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et4@21:1/5 to Harald Oehlmann on Fri Oct 28 14:15:22 2022
    On 10/28/2022 3:29 AM, Harald Oehlmann wrote:
    Am 28.10.2022 um 02:01 schrieb et4:
    Below is a modified example script from the manual on [tk_popup] where I added 2 checkbuttons and 2 radiobuttons. I'm not seeing what the manual describes under the [menu ]command. Are tk_popup's different some how? Or is there something I'm missing
    to get it to display the "box".

    Manual:

    "An indicator box is displayed to the left of the label in a checkbutton entry. If the entry is selected then the indicator's center is displayed in the color given by the -selectcolor option for the entry; otherwise the indicator's center is
    displayed in the background color for the menu."

    The problem is that it's not possible to tell from the menu items which are checkboxes or radiobuttons and which are commands, except when the item is selected since there is no "box" as the manual says. Usually one would see a box around a checkmark,
    or an empty box.

    I fear, your observation is intended behaviour.
    On Windows, native menus are used and that's the way, it is done on Windows usually.
    To mark a group of radio buttons, you can:
    - initialize the variable, so one is checked at the beginning.
    - add separator lines to group the radio-button region
    - or put the radio-buttons into a sub-menu.

    Thank you and take care,
    Harald

    Thanks, I've decided to add a little unicode box for checkboxes, and one with a dot inside it for the radio buttons. Command entries will just use a space where the box would go. The checkmark will have to be beside them however. As suggested, I'm using
    separators to group the radio buttons.

    Strange, I know I've seen tk code with these indicators before. Wonder when this changed.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Sat Oct 29 11:55:33 2022
    Am 28.10.2022 um 23:15 schrieb et4:
    Thanks, I've decided to add a little unicode box for checkboxes, and one
    with a dot inside it for the radio buttons. Command entries will just
    use a space where the box would go. The checkmark will have to be beside
    them however. As suggested, I'm using separators to group the radio
    buttons.

    Strange, I know I've seen tk code with these indicators before. Wonder
    when this changed.

    On some Linux themes, you will have it. Good old Motiv had it.
    But on Windows, you have no choice, only native menues available, and
    they only show a blank field.

    I don't know, if you can use non-native menus on Windows. Other may
    advice. This would have a lot of advantages, like font scaling, colours,
    and the boxes you are asking for.

    Take care,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luc@21:1/5 to Harald Oehlmann on Sat Oct 29 07:25:26 2022
    On Sat, 29 Oct 2022 11:55:33 +0200, Harald Oehlmann wrote:

    On some Linux themes, you will have it. Good old Motiv had it.
    But on Windows, you have no choice, only native menues available, and
    they only show a blank field.

    I don't know, if you can use non-native menus on Windows. Other may
    advice. This would have a lot of advantages, like font scaling, colours,
    and the boxes you are asking for.

    Take care,
    Harald


    Harald makes an interesting comment. First, he mentions only native menus available on Windows, then he mentions font scaling.

    So I edited the original code just adding -font options. I used a large font and it works. Of course, I'm on Linux.

    And that made me think: if this widget and how it's going to look really matters to you, then why not make your own menu? I mean, instead of using
    the 'menu' command, make a new window with a frame and/or a canvas and add
    your checkbuttons and radiobuttons and whatever you want, groom it however
    you want and make the whole thing look like whatever you want. Then you
    just have to run a little calculation to determine where it's going to pop
    up like a real menu would. It's a little bit more of work, but hey, looks
    do matter. Tcl/Tk will let you do that.


    --
    Luc


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et4@21:1/5 to Luc on Sat Oct 29 20:24:58 2022
    On 10/29/2022 3:25 AM, Luc wrote:
    On Sat, 29 Oct 2022 11:55:33 +0200, Harald Oehlmann wrote:

    On some Linux themes, you will have it. Good old Motiv had it.
    But on Windows, you have no choice, only native menues available, and
    they only show a blank field.

    I don't know, if you can use non-native menus on Windows. Other may
    advice. This would have a lot of advantages, like font scaling, colours,
    and the boxes you are asking for.

    Take care,
    Harald


    Harald makes an interesting comment. First, he mentions only native menus available on Windows, then he mentions font scaling.

    So I edited the original code just adding -font options. I used a large font and it works. Of course, I'm on Linux.

    And that made me think: if this widget and how it's going to look really matters to you, then why not make your own menu? I mean, instead of using
    the 'menu' command, make a new window with a frame and/or a canvas and add your checkbuttons and radiobuttons and whatever you want, groom it however you want and make the whole thing look like whatever you want. Then you
    just have to run a little calculation to determine where it's going to pop
    up like a real menu would. It's a little bit more of work, but hey, looks
    do matter. Tcl/Tk will let you do that.



    Which font did you use. I tried several including courier and consolas (not sure what linux really used there) and there are still no indicator boxes. I tried a huge size too, 36 pt, and while the 7 menu items got very large, the check box was tiny,
    almost couldn't see it.

    My concern is not so much in how they look, just that a user should feel safe clicking on a checkbox, but might wonder what's going to happen if it's a command. That's why I want an indicator box. My workaround shows the user which ones are checkboxes
    and radio buttons now. So, it ends up looking strange with the checkmark next to the box rather than inside it, but I think a user will be able to figure it out.

    thanks

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luc@21:1/5 to All on Sun Oct 30 01:15:27 2022
    On Sat, 29 Oct 2022 20:24:58 -0700, et4 wrote:

    On 10/29/2022 3:25 AM, Luc wrote:
    On Sat, 29 Oct 2022 11:55:33 +0200, Harald Oehlmann wrote:

    On some Linux themes, you will have it. Good old Motiv had it.
    But on Windows, you have no choice, only native menues available, and
    they only show a blank field.

    I don't know, if you can use non-native menus on Windows. Other may
    advice. This would have a lot of advantages, like font scaling,
    colours, and the boxes you are asking for.

    Take care,
    Harald


    Harald makes an interesting comment. First, he mentions only native
    menus available on Windows, then he mentions font scaling.

    So I edited the original code just adding -font options. I used a large font and it works. Of course, I'm on Linux.

    And that made me think: if this widget and how it's going to look really matters to you, then why not make your own menu? I mean, instead of
    using the 'menu' command, make a new window with a frame and/or a
    canvas and add your checkbuttons and radiobuttons and whatever you
    want, groom it however you want and make the whole thing look like
    whatever you want. Then you just have to run a little calculation to determine where it's going to pop up like a real menu would. It's a
    little bit more of work, but hey, looks do matter. Tcl/Tk will let you
    do that.



    Which font did you use. I tried several including courier and consolas
    (not sure what linux really used there) and there are still no indicator boxes. I tried a huge size too, 36 pt, and while the 7 menu items got
    very large, the check box was tiny, almost couldn't see it.

    My concern is not so much in how they look, just that a user should feel
    safe clicking on a checkbox, but might wonder what's going to happen if
    it's a command. That's why I want an indicator box. My workaround shows
    the user which ones are checkboxes and radio buttons now. So, it ends up looking strange with the checkmark next to the box rather than inside it,
    but I think a user will be able to figure it out.

    thanks
    ************************

    I am sorry I misled you with my bad wording. When I said "it works" I
    really meant that the large font worked after Harald had said that Windows would have font scaling issues. Just that. The checkboxes and radiobuttons didn't work for me either.

    You have concern for the looks if you think the current look is going to confuse the user. You definitely need something that looks like what it is intended. I say you should fashion your own menu.

    --
    Luc


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