popupmenu

PopupMenu not showing icons and how to highlight PopupMenu item when its opened

…衆ロ難τιáo~ 提交于 2020-01-06 06:40:24
问题 I am using PopupMenu from android.support.v7. I am trying to show icons with text. But only text is showing. I tried to used normal code: android:icon="@android:drawable/ic_menu_camera" but its not working with PopupMenu. One more question, can we highlight PopupMenu item when its opened ? Please check the reference image here 回答1: If you are using popup menu just copy the below code and run it, you will get icons in popupmenu PopupMenu popup = new PopupMenu(getApplicationContext(), view);

PopupMenu not showing icons and how to highlight PopupMenu item when its opened

有些话、适合烂在心里 提交于 2020-01-06 06:39:48
问题 I am using PopupMenu from android.support.v7. I am trying to show icons with text. But only text is showing. I tried to used normal code: android:icon="@android:drawable/ic_menu_camera" but its not working with PopupMenu. One more question, can we highlight PopupMenu item when its opened ? Please check the reference image here 回答1: If you are using popup menu just copy the below code and run it, you will get icons in popupmenu PopupMenu popup = new PopupMenu(getApplicationContext(), view);

Add an item in Finder's contextual menu with Cocoa

心不动则不痛 提交于 2020-01-05 08:46:23
问题 In Cocoa on Mac, I would like to add a menu item in the Finder's popup menu that comes when I right-click on a file or a folder, and having this item pointing to a function in my app. How can I achieve this ? Thanks ! 回答1: A good place to start is CocoaDev: StandardService. It outlines what you are trying to accomplish and they give some source code to follow such as the MakingServices example. 2015 Update: As of Yosemite, Apple includes an extension called Finder Sync which allows you to

JComboBox popup menu not appearing

ⅰ亾dé卋堺 提交于 2020-01-02 17:20:11
问题 I have a JComboBox inside a JPanel (which itself is nested within a few other JPanels). It's populated with members of an enum. I'm running into a problem where the popup menu doesn't appear when I click the expand button. Here's the information I've gathered so far: 1) The first click on the expand button does nothing. The second click highlights the contents of the box, but the popup still doesn't appear. 2) Once I've clicked the button and given it focus, up/down keystrokes cycle through

What is alternative to NSStatusItem.popUpMenu?

痞子三分冷 提交于 2020-01-01 09:48:53
问题 NSStatusItem.popUpMenu has been deprecated in macOS 10.14, but I can't find a nice alternative. let m = statusItem.menu! statusItem.popUpMenu(m) // deprecated I tried direct pop-up using menu and the button, but it doesn't position properly. let m1 = m.items.first! m.popUp(positioning: m1, at: .zero, in: statusItem.button!) 回答1: Xcode suggests to use menu property instead of popupMenu . But once you set the menu property, every click on the item will only show the menu. Instead, if you want

Hide item from popupmenu

核能气质少年 提交于 2019-12-29 07:22:26
问题 I created a popup menu. I need to hide a particular item from popup menu on condition, I tried this below code but it doesn't work and shows "unexpectedly your app has been stopped" . I used findViewById and setEnabled(false) . Is there any other way to hide an item from popup menu? Please help with this. @Override public boolean onOptionsItemSelected(MenuItem item) { // TODO Auto-generated method stub switch(item.getItemId()){ case R.id.addMessage_Action: AddMessage(); break; case R.id

Attempted to finish an input event but input event receiver has already been disposed

一世执手 提交于 2019-12-29 04:30:11
问题 I have a custom adapter for my listview. The adapter contains a textview and a image button. I have implemented a popup menu on clicking the image button. Everything is working fine. But when selecting the options from popup menu, logcat displaying a single line message "Attempted to finish an input event but input event receiver has already been disposed" and nothing is happening. public class MyAdapter extends ArrayAdapter<String> { public MyAdapter(Context context, int resourceId) { super

How to set the background of Android PopupMenu to White [duplicate]

本秂侑毒 提交于 2019-12-28 13:58:05
问题 This question already has answers here : How to style PopupMenu? (6 answers) Closed 6 years ago . I'm struggling with setting the background of PopupMenu. After googling it for a while, I found it should goes to the app theme. To be more specific, this should be defined in the style.xml. <style name="AppTheme" parent="AppBaseTheme"> <item name="android:popupMenuStyle">MY_STYLE</item> </style> However, I didn't really figure out which style exactly I should use, as I assume there's a built-in

Changing the background color of a Popup menu

牧云@^-^@ 提交于 2019-12-24 17:28:29
问题 In my Android app, I am using a popup menu but its background is green. I want it to be white. The background is white if I run it on my Android 6.0 device, but shows up green on my Jellybean device. I'm not using the Actionbar. There are many posts about this issue and I've tried probably most of them but can't find the solution. The closest I got was a white background but then the border disappears. Or I get a white background but when pressing on an item, the selection shows a grey

Automatically Hide or Close PopUp Menu when Mouse Pointer is outside it - Delphi

纵然是瞬间 提交于 2019-12-23 05:18:00
问题 I have a PopupMenu in my Application which pops up when a user right clicks on my App's Notification Area icon. When I right click on this icon, pop up the menu, and do nothing, my App behaves like resuming its work because it looks like it is waiting until I click on a Menu Item. I want to remove this behavior. I tried fixing the PopupMenu by adding an Auto-Close procedure when no response comes from the user and when the Mouse Pointer leaves the PopupMenu. I also tried adding a TTimer that