NSOpenPanel New Document button not working - objective-c

I can't seem to get the Open Panel's New Document button to work. Currently I am just using the default application provided Open Panel (iCloud enabled OS X app) which has a New Document button at bottom left of the window.
However I just get a system beep when I click on it, I would expect this button would do the same as File->New menu option but it does nothing other than beep.
How can I either enable this button to simply create a new blank file or remove it altogether.

Finally I figured it out.
It seems the New Document button is somehow hardware to the CMD+N keystrokes. I had reassigned CMD+N to apply Normal style to text and this breaks the New Document button.
Seems odd that the button is not wired to newDocument method on First Responder rather than to a keystroke combination.
EDIT
I logged a Bug ID# 14886108 and it seems it may be fixed in Mavericks

Related

Form from external DLL does not Show after being minimized

This is probably behavior by design, but I'll ask anyway -
I call a form from another project dll in my main project. It is NOT Modal (ShowDialog) or TopMost, and I set a variable for the form once it's created ("frm = New ..."), so that I can check when it's already been created (user clicks a toolbar button to create it initially.)
The form displays, fires events etc. all perfectly.
However, if I MINIMIZE the form and then call frm.Show through code to bring it back, nothing happens. The form remains minimized.
frm.Show has no affect and doesn't seem to fire any other events.
The only way to bring it back is to click on the taskbar icon for the MAIN form, which then displays the MAIN form AND the minimized forms (as icons), and then click on the icon for the minimized form.
I've tried various events (.Activate, .Show, .ShowDialog, .Focus) NOTHING will bring the other form out of its minimized state other than physically clicking on the Taskbar MAIN app icon and then selecting it.
Also, the main application is not MDI...
???
Thanks.
normally this should do it as suggested by #jimi
[TheForm].WindowState = FormWindowState.Normal
But sometimes this does not works for some dark reason, so you could use some other methods
form.Show();
form.BringToFront();
if (form.WindowState == FormWindowState.Minimized)
{
ShowWindowAsync(form.Handle, 9); // 9 = SW_RESTORE
}
I am sure there is one of these that will fix your problem

Showing Tool-tips while Application is in the System Tray?

In my application when it is iconized in the system tray, and through a ContextMenuStrip1 displays a context menu and when I click the icon I can choose what to display; the application, close it etc.
Now, when the mouse is over the icon I would like to show a tooltip (property that unfortunately does not have, but that have the individual menu items), it always shows me the name of the menu object: ContextMenuStrip1, even in its text property set something else.
Since at some times the app makes updates in background I would like to show under the icon a small progressbar as do some application. How is this possible in vb.net? (I'm using VB2012)
Thank you all.
I resolved you need to use the Text property of the notifyIcon object.

vb.net menu strip shadow remains after viewing

I am using a MenuStrip in my application like this:
Private top_menu As New MenuStrip
Private menu_item_file As New ToolStripMenuItem("File")
and I add items to the menu like this:
With top_menu
.Items.Add(menu_item_file)
End With
With menu_item_file
.DropDownItems.Add(sub_menu_item_show_all)
.DropDownItems.Add(sub_menu_item_show_reg)
End With
The menu drops down and it has a shadow (by default). It works fine in Windows7, but when I test it in XP, the shadow remains after the user moves away from the menu (or clicks the item). I can't figure out what is causing this. The menu continues to work fine and drops down every time the user hovers over it, but the shadow never goes away. The menu does drop down over an existing panel which has a picture in it, but I don't think that is causing this behavior.
It's some kind of bug in Win XP. Only appears when you have set your picture to your bacground. Cured by turning off shadows in Win XP.
http://www.codeproject.com/Articles/19277/Let-Your-Form-Drop-a-Shadow

App calls Method on mouse click. How can I stop it?

So I am pretty new to Xcode and Objective C, I've been using it about 2 weeks now. I am building an app for OSX. One of the windows in the app has 5 text boxes, some labels and a submit button at the bottom. The submit button is linked to a method that closes the window, opens a new one and outputs the contents of the text boxes into one text field on the new window.
I had it working correctly, but now when I do anything but click on the top text field the submit method is called and the window closes. I can click on the black space in the window, but click on any of the objects calls the method. Also, pressing tab calls the method. I am not sure when I did to cause this error, but any insight or tips would be very useful.
Sorry if this is vague, I'm not even sure how to describe the problem. If you need any specific information please ask.
Try looking in Interface Builder. Ctrl Click or Right click on the each one of the fields that are responding with calling the function. See if they are linked to the function.
Also check the "responder" as was suggested earlier. You can do this by also right click or ctrl clicking the red responder box labeled "responder". See if anything in there maps to your function

Application hangs on clicking "Choose" button in IKPictureTaker view

I am facing a strange hang issue with IKPictureTaker and on clicking a "Choose" button. I am doing below operation using IKPictureTaker.
When a user wants to change a profile picture, upon clicking "Change Image" button, I display a IKPictureTaker view along with "Choose" button by setting IKPictureTakerAllowsFileChoosingKey to YES.
First time on clicking the "Choose" button, open panel will be displayed allowing user to select an image of his choice.
Next, on clicking the "Set" button, internally I am calling a profile picture upload function of a server in a separate thread and everything works great.
Next if the user tries to do the operation 1) and 2) again application hangs on clicking the "Choose" button.
After investigation I found that this issue is something to do with the background upload operation I am doing with the server.Because if I comment the upload part of code everything looks good.
I don't see any issues with the upload operation performed in the separate thread and it gives up it s runloop once it is done with its upload operation and all UI related operations again taken care in the main thread.
Application hangs only if I click on the "Choose" button. If I select the recent pictures or take a new photo using the camera everything works great.
Is there anyone who faced the same issue? Is it something to do with the NSOpenPanel displayed when we click on the "Choose" button?