Applescript has a display dialog function in which one can summon a pop-up, and by using buttons {"x","y","z"} one can add custom buttons to the dialog. Is there a way to get these buttons to appear on the touch bar as well, as pop-ups typically do?
Related
I'm using a NSAlert to ask the user to enable Accessibility for assistive devices. Is it possible to have a button that does not close the NSAlert that I could use to just open the UniversalAccess prefpane ?
If not, I suppose I've to create myself that window.
Thx.
Normally alerts close when any button is pressed. In Mac OS X 10.5 or later you can use setAccessoryView: to insert a custom view into the alert, which presumably can contain a button that does anything you want.
Note however that you can't specify where the accessory view goes. It might have a button in it but the button would show up in the middle of the window instead of along the bottom with the other buttons. (If you chose a different button style such as a square bevel for your custom button, it might look less out of place.) To have complete control over layout, you need to make your own alert window.
In windows phone 7, I want to show a full screen mode of a listpicker control on a button click (ideally application bar button click). Is it possible to do that?
I do not want to display the listpicker as it is kind of redundant in my app. I could have something like "goto" in the application bar and when the user clicks on it, show a listpicker fullscreen mode directly. Thanks.
Correct me if I'm wrong but if all you want is a ListPicker, but without any of the functionality of the picker - just the list of items - isn't what you want just a ListBox?
You could lay a ListBox control over the top of the entire phone page with it's Visibility to Collapsed. When the user presses your application bar button change the Visibility to Visible and your list will appear in full screen. When the user selects an item, set the Visibility back to Collapsed to have the ListBox disappear again.
If I'm understanding you correctly that should give the effect that you are looking for.
I am trying to interface with a cocoa popup menu from an OpenGL button. The actual button needs to be in OpenGL and I cannot stick an actual Cocoa button in its place but when this button is pressed I would like for a Cocoa menu to popup just like the one that comes up when you press the nspopupbutton. It seems that there is no way to get this popup window to come up by itself so I wanted to just insert an invisible button and have it be pressed automatically when the popup menu method is called. Is there a way to programmatically set a button to pressed (this will bring up the menu from the popupbutton) and make the button itself invisible without making the resulting menu invisible?
It seems that there is no way to get this popup window to come up by itself
Sure there is. See + popUpContextMenu:withEvent:forView:
Have you thought about just using a regular NSMenu, rather than trying to finagle the menu from an NSPopupButton?
I have labels and fields in my application screen. When i launch to a particular screen which has many labels and editfields and buttons. The problem is, when i launch a particular screen, default menu is popping up with "Show Keyboard", "Switch Applicaiton" and "Full menu" automatically when launching a particular screen. I don't want to get this menu when launching a screen. How do i ignore showing it? How to do that. Please advice.
Note: Eventhough there is no controls in the same screen, Menu is still popping up this.
Thanks.
If you're using a ButtonField to launch the new screen, make sure you add the ButtonField.CONSUME_CLICK style to its constructor so that the click event is not passed on down to the screen.
When you press the keys for an NSMenuItem keyboard shortcut on Mac, the menu itself highlights to indicate that an action in that menu has been activated.
If you are not familiar with the effect try it now by selecting some text and while pressing CMD-C, watch the Edit menu. It will flash blue to indicate you activated a shortcut for an item in that menu.
I want to achieve the same effect programmatically, preferably without faking the keyboard entry. Thanks for your time.
Use the Accessibility framework. Find the menu item and send it an AXPress action.