Python Forum
[Tkinter] tkinter.Menu – How to make text-variable?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] tkinter.Menu – How to make text-variable?
#3
The best documentation for tkinter may be to look at the underlying tk commands.

https://www.tcl.tk/man/tcl8.6/TkCmd/contents.htm

For example, the tk documentation has this to say about label.
Quote:Command-Line Name: -textvariable
Database Name: textVariable
Database Class: Variable
Specifies the name of a global variable. The value of the variable is a text string to be displayed inside the widget; if the variable value changes then the widget will automatically update itself to reflect the new value. The way in which the string is displayed in the widget depends on the particular widget and may be determined by other options, such as -anchor or -justify.

Looking under menu I only find 1 variable.
Quote:-variable value
Available only for checkbutton and radiobutton entries. Specifies the name of a global variable to set when the entry is selected. For checkbutton entries the variable is also set when the entry is deselected. For radiobutton entries, changing the variable causes the currently-selected entry to deselect itself.
For checkbutton entries, the default value of this option is taken from the -label option, and for radiobutton entries a single fixed value is used. It is recommended that you always set the -variable option when creating either a checkbutton or a radiobutton.
Sir likes this post
Reply


Messages In This Thread
RE: tkinter.Menu – How to make text-variable? - by deanhystad - Mar-10-2021, 03:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  make widgets disappear from tkinter jacksfrustration 12 1,176 Feb-06-2024, 03:58 PM
Last Post: deanhystad
  pass a variable between tkinter and toplevel windows janeik 10 2,365 Jan-24-2024, 06:44 AM
Last Post: Liliana
  [Tkinter] Updating tkinter text BliepMonster 5 6,061 Nov-28-2022, 01:42 AM
Last Post: deanhystad
  [Tkinter] The Text in the Label widget Tkinter cuts off the Long text in the view malmustafa 4 4,930 Jun-26-2022, 06:26 PM
Last Post: menator01
  Why I am getting ModuleNotFoundError when I make an Exe file for tkinter GUI? pymn 0 1,660 Apr-01-2022, 05:36 PM
Last Post: pymn
  [Tkinter] Update variable using tkinter entry methon drSlump 6 5,225 Oct-15-2021, 08:01 AM
Last Post: drSlump
  tkinter change the text of the checkbox zazas321 1 3,846 Sep-17-2021, 06:19 AM
Last Post: zazas321
  [Tkinter] It it possible to make a help file explorer with tkinter? Clunk_Head 0 1,994 Aug-07-2021, 06:02 PM
Last Post: Clunk_Head
  [Tkinter] Make my button text update? Skata100 1 2,043 Aug-07-2021, 05:37 AM
Last Post: deanhystad
  Updating button text based upon different variable values knoxvilles_joker 0 2,242 Apr-18-2021, 04:13 AM
Last Post: knoxvilles_joker

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020