I have created desktop application for mac.I want to put some image and item name on the customize toolbar.I dont know how to implement that things.can you give me some advice for that.thanks in advance.
In interface builder, double-click on an empty space on the toolbar and it will open up. You can drag an NSToolbarItem to the open area. You can then add a name, an image, and hook up an action to the toolbar item in the inspector.
Related
I have a NSWindow with customisable NSToolbar
It has default menu items like Icon and Text, Icon Only, Text Only, Customize Toolbar..
I recently added some more menu items to this specific menu with:
<WindowSetup>
....
<ToolbarSetup>
...
contentView?.superview?.menu?.addItems([NSMenuItem.separator(), menuItem1, menuItem2])
They work perfectly in all scenarios except FullScreenMode.
In FullScreenMode menu items added by me are getting disabled.
I tried overriding validateMenuItem but it doesn't help.
Can anyone help out on why these menu-items getting disabled and any way to keep them enabled (and usable)?
According to my understanding if I need design MFC form with button I have only one possibility - write everything in code editor. There is no designer. Except cases when I need design dialog form. I can use designer and generate resources for dialogs. But in case normal Frame there is possibility to drop buttons in designer window. Is that truth?
If you want to use a form as a main window, create your project with a CFormView as a base class. You can select that inside the new project wizard. Then you get a dialog resource for that view. It works just like a dialog.
Go to Resource view
Create a new dialog template
Double click the dialog template name
Once the dialog opens, the toolbox get enabled
You can drag&drop the controls to the form now
Trying to run a KIF test. I want to tap the button with accessibility label "LOG IN" but it times out with the message "view is not enabled for interaction".
[tester tapViewWithAccessibilityLabel:#"SIGN IN"];
The button is there, and it has this text in its label. How do I "enable" this UI element?
FOR KIF: Another way to tell information for user interaction on views is to turn on the Accessibility Inspector within the iOS simulator. This will let you click on views and see if they're actually clickable/or blocked by other views inadvertently. It will also show you if the view has an accessibility label, trait (button, label, static text), and/or frame. Useful for checking your user interaction - ie. if it's static text or a button etc.
TO TURN ON ACCESSIBILITY INSPECTOR: Run your app, open the simulator--->click on the home button---->go to settings--->general--->accessibility--->toggle the accessibility inspector to ON--->run your app again or click on HOME button again, then click on your app.
You get this error message if isUserInteractionActuallyEnabled of a view yields NO. For example have a look at the definition of tapAccessibilityElement:inView: in KIFUITestActor.m. The method isUserInteractionActuallyEnabled is implemented in UIView-KIFAdditions.m and basically checks the property isUserInteractionEnabled of a view and does some more elaborate checks if you tap a button in a navigation bar or an action sheet.
You should try to set accessibilityLabel in Xcode's interface builder under the identity inspector at the user defined runtime attributes (with the key path set to "accessibilityLabel", type set to "String" and value set to "SIGN IN".
There are other ways to set accessibilityLabel like from code you can say:
[_buttonName setValue:#"SIGN IN" forKey:#"accessibilityLabel"];
I hope this one helped.
How do you add an image in UIImageView? Whenever I click the drop down menu it just comes up with an empty white space. Where do you add the image?
Amar
The image needs to be in your project for you to select it in interface builder.
Drag the image you want into your xcode project select Copy items into destination group's folder (if needed) and try again
On the right sidebar, theres an option to add the name of the image. i.e: my_image.png. As long as my_image.png is included in your project files, then it will show up in Interface Builder.
Wondering how hard/how one would go about changing the default Icon using netbeans GUI builder, Just wondering if it is possible to load an image to be the icon of button, rather then just the default silver/blue. Any help would be great! thank you.
When you're in the GUI builder select the JButton and you will be presented with its Properties in the palette (default location) click on the icon (...) button and you will be presented with the following screen that allows you to choose an Icon for the button.
Create new Package image.
Find folder [image(package)] in [src] folder of [Project Folder], and copy images to it.
In the Properties window of button, click the Properties category and scroll to the Icon property.
Select Package: jframe.image and File: in list.
Reference:
Insert icon image on JButton in NetBeans.