The Menubutton widget can be defined as the drop-down menu that is shown to the user all the time. It is used to provide the user a option to select the appropriate choice exist within the application.
The Menubutton is used to implement various types of menus in the python application. A Menu is associated with the Menubutton that can display the choices of the Menubutton when clicked by the user.
The syntax to use the python tkinter Menubutton is given below.
A list of various options is given below.
||The background color of the widget when the widget is under focus.
||The font color of the widget text when the widget is under focus.
||It specifies the exact position of the widget content when the widget is assigned more space than needed.
||It specifies the background color of the widget.
||It is set to the graphical content which is to be displayed to the widget.
||It represents the size of the border. The default value is 2 pixels.
||The mouse pointer will be changed to the cursor type specified when the widget is under the focus. The possible value of the cursor type is arrow, or dot etc.
||It direction can be specified so that menu can be displayed to the specified direction of the button. Use LEFT, RIGHT, or ABOVE to place the widget accordingly.
||The text color of the widget when the widget is disabled.
||The normal foreground color of the widget.
||The vertical dimension of the Menubutton. It is specified as the number of lines.
||The highlight color shown to the widget under focus.
||The image displayed on the widget.
||This specified the exact position of the text under the widget when the text is unable to fill the width of the widget. We can use the LEFT for the left justification, RIGHT for the right justification, CENTER for the centre justification.
||It represents the menu specified with the Menubutton.
||The horizontal padding of the widget.
||The vertical padding of the widget.
||This option specifies the type of the border. The default value is RAISED.
||The normal state of the Mousebutton is enabled. We can set it to DISABLED to make it unresponsive.
||The text shown with the widget.
||We can set the control variable of string type to the text variable so that we can control the text of the widget at runtime.
||The text of the widget is not underlined by default but we can set this option to make the text of the widget underlined.
||It represents the width of the widget in characters. The default value is 20.
||We can break the text of the widget in the number of lines so that the text contains the number of lines not greater than the specified value.