An optionmenu is a UI construct that presents the user with a list of options.
Questions tagged [optionmenu]
453 questions
90
votes
12 answers
android: changing option menu items programmatically
Is it possible to change the option menu items programmatically? Can anyone provide me with an example please?
Also, I want to disable certain items, so that they don't listen to the clicks, is it possible?

Farhan
- 3,206
- 14
- 49
- 62
48
votes
6 answers
How can I get the options menu of my Activity?
In some methods of my Activity I want to check the title of menu or know if it is checked or not. How can I get Activity's menu. I need something like this.getMenu()

Bob
- 22,810
- 38
- 143
- 225
36
votes
4 answers
What does onPrepareOptionsMenu do?
I want to make Option Menu for Android, I have visit this site. In their script, I found onPrepareOptionsMenu, I try to compile and run using Android 2.3.3 compiler with and without onPrepareOptionsMenu, both works, but I didn't see any…

Tutompita
- 639
- 1
- 5
- 14
27
votes
3 answers
How to hide option menu?
I am using option selected menu item, attached three item (share, login, logout) am select login item, go login activity login social sign (Facebook or google) any one, if login hide login item at same time show logout item, this same type if logout…

Krishnan
- 428
- 1
- 4
- 11
22
votes
5 answers
Show Menu item always in support action bar
I am working on android application . I have implemented supported action bar in it .I want to show option menu item always . But it is not showing . it is showing in drop down menu . my code for menu item given below.
-

Nitesh Kabra
- 265
- 1
- 3
- 7
21
votes
1 answer
Android Option Menu on Button click
I am trying to show the Option menu on button click.How can I do this can anyone tell me.

Altaf
- 5,150
- 10
- 39
- 55
21
votes
5 answers
tkinter optionmenu first option vanishes
A ttk optionmenu widget starts out with all of its values in the dropdown. Upon selecting any value, the first value in the list vanishes, never to reappear...
Does anyone know why? Is this a feature of the widget's design? Try it with the…

Tom
- 371
- 1
- 6
- 16
21
votes
5 answers
how we can add menu item dynamically
hi frnds am creating an application which is a tab application.
in my Home which extends sherlockFragmentActivity, i am inflating menu.xml and includes code for on optionMenuitem click listener. The Fragmentactivity contains tabhost and on each tab…

Vikky
- 933
- 2
- 15
- 29
19
votes
2 answers
Change OptionMenu based on what is selected in another OptionMenu
I am currently trying to make two OptionMenus, where the second will be updated dynamically based on what is selected in the first OptionMenu.
For example, I would like to make OptionMenu_A with list
[North America, Europe, Asia]
If Asia is…

user2511875
- 493
- 3
- 6
- 13
18
votes
4 answers
Changing the options of a OptionMenu when clicking a Button
Say I have an option menu network_select that has a list of networks to connect to.
import Tkinter as tk
choices = ('network one', 'network two', 'network three')
var = tk.StringVar(root)
network_select = tk.OptionMenu(root, var, *choices)
Now,…

charmoniumQ
- 5,214
- 5
- 33
- 51
16
votes
4 answers
Changing default icon in tkinter OptionMenu?
I am trying to remove the default "box like" icon from the tkinter OptionMenu and replace it with my own image file. below is the code I have to date. It is working but I had to add the last line to get it to display the arrow image and for the…
user1214192
14
votes
5 answers
How to make a OptionMenu maintain the same width?
I have a snippet which creates an OptionMenu widget.
...
options = ('White', 'Grey', 'Black', 'Red', 'Orange',
'Yellow', 'Green', 'Blue', 'Cyan', 'Purple')
var = StringVar()
optionmenu = OptionMenu(par, var,…

rectangletangle
- 50,393
- 94
- 205
- 275
14
votes
5 answers
detecting a click on action bar back button -(OnOptionsItemSelected not calling when click on action bar back button)
I have an action bar containing a searchview. When user click on the search button and collapse the search view the action bar shows a back button on the left side.
How can we detect when user click on this back button?
Edit
based on the answer I…

Husein Behboudi Rad
- 5,434
- 11
- 57
- 115
14
votes
4 answers
Android: How can I set a listener to the MenuButton?
I want to do a custom action when pressing on the Menu button on the phone.
Is it possible to set an onClickListener (or similar) on the button and if so, how?
onCreateOptionsMenu is only called the first time the button is pressed - I've already…

whlk
- 15,487
- 13
- 66
- 96
13
votes
2 answers
How to change menu background color of Tkinter's OptionMenu widget?
If I take a simple example of OptionMenu from http://effbot.org/tkinterbook/optionmenu.htm, and add a line that sets background color (see below), only the button background changes color, not the drop-down menu which remains gray. Can I set color…

Victor
- 316
- 1
- 2
- 6