tkinter: Can You Underline More Than 1 Char In A Menu Title

T

Tim Daneliuk

I am currently underling the first character of a menu title (to indicate
its shortcut/accelerator key) like this:

self.WildBtn = Menubutton(self.mBar, text=WILDMENU, underline=0, state=DISABLED)

However, I intend to actually have two separate keys invoke this menu
to have it behave differently in different circumstances.

Is it possible to underline more than a single character as I am doing
with the 'underline=0' above. I tried 'underline=(0,2)' but that didn't
work.

Ideas?

TIA,
 
J

Jeff Epler

Is it possible to underline more than a single character as I am doing
with the 'underline=0' above. I tried 'underline=(0,2)' but that didn't
work.

No.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFB+bG1Jd01MZaTXX0RAqvPAJ9nXk7km0ju+yn7RajPkZEHLibL+ACglLAx
eOkRfB8l+tIUUibGHw6itZQ=
=IGHj
-----END PGP SIGNATURE-----
 
T

Tim Roberts

Tim Daneliuk said:
I am currently underling the first character of a menu title (to indicate
its shortcut/accelerator key) like this:

self.WildBtn = Menubutton(self.mBar, text=WILDMENU, underline=0, state=DISABLED)

However, I intend to actually have two separate keys invoke this menu
to have it behave differently in different circumstances.

You can, of course, CHANGE the underlined character to match the
circumstances.
 
T

Tim Daneliuk

Tim said:
You can, of course, CHANGE the underlined character to match the
circumstances.

Yeah, I understand that ... what I want is two characters simulatenously
underlined ... oh well, another solution will be arranged...
 
F

Fredrik Lundh

Tim said:
Yeah, I understand that ... what I want is two characters simulatenously
underlined ... oh well, another solution will be arranged...

if you want a menu choice to have different behaviour depending on what
key you use to invoke them, you should use two different choices.

</F>
 
T

Tim Daneliuk

Fredrik said:
Tim Daneliuk wrote:




if you want a menu choice to have different behaviour depending on what
key you use to invoke them, you should use two different choices.

</F>

That is my intention. I have a menu that lists a set of regular expressions
available for a particular task. However, the regex are applied in two
different ways for this task. I want a common menu for displaying all
the choices, but two separate "Accelerator Keys" to invoke it, depending
on the desired application...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top