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.
Am 28.10.2022 um 02:01 schrieb et4:to get it to display the "box".
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
displayed in the background color for the menu."
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
or an empty box.
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,
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.
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
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.
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
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 714 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 140:37:41 |
| Calls: | 12,087 |
| Files: | 14,998 |
| Messages: | 6,517,424 |