Re: Input Panel
Re: Input Panel
- Subject: Re: Input Panel
- From: Brian Ganninger <email@hidden>
- Date: Tue, 13 Jan 2004 14:52:06 -0600
Very simple.
Create a window in your nib, make it look at you envision (and wire
everything appropriately to actions)
[NSApp beginSheet:newWindow modalForWindow:mainWindow
modalDelegate:self
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo:nil];
Most demos include code similar to above to run a sheet. newWindow is
an IBOutlet linked to your sheet, mainWindow is your... main window :),
delegate - optional, tells the sheet who receives a method call when a
something happens, contextInfo - optional, selector - the method to
call, this is a fairly standard format for the name to send all the
information you may need access to.
(to clarify, you could either wire the buttons directly to apply or
cancel, or you could run them through a single method such as above and
have it distinguish which was pressed (returnCode) and work only in 1
method instead)
NSAlertPanel creates a pre-fabbed alert window with strings for the
buttons, title, & message while the above method is for a custom sheet.
HTH,
brian
On Jan 13, 2004, at 8:20 AM, Wezzy wrote:
>
Hi, i'm searching for a class that display a simple box with a single
>
NSTextField istance and an "ok" button. I have to build one by my self
>
or AppKit includes somethig useful ? i've found NSAlertPanel for
>
displaying message Box but nothing for input Box (ouch i write like a
>
VB dev )
>
>
Thanks
>
Wazzy
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.