Re: document based app, custom ibaction
Re: document based app, custom ibaction
- Subject: Re: document based app, custom ibaction
- From: Graham Cox <email@hidden>
- Date: Tue, 19 Aug 2008 22:03:38 +1000
On 19 Aug 2008, at 7:03 pm, Bart wrote:
Another similar problem.
I would like to add a sheet to the button I've created. Normally I
would create an IBOutlet and connect the window for the sheet to it,
combined with a code to open:
[NSApp beginSheet:totalsSheet
modalForWindow:[NSApp mainWindow]
modalDelegate:self
didEndSelector:NULL
contextInfo:NULL];
and close it:
[NSApp endSheet:totalsSheet];
[totalsSheet orderOut:sender];
However, is this possible when using a mydocument class, because I
cannot find any outlets in the interface builder....
So, add the outlets you need to the class. It is called *MY*document
after all - it's yours ;-)
e.g. in MyDocument.h, add the instance variable:
IBOutlet id mySheetWindow;
and this will show up in IB for you to connect to.
(This probably isn't the time to get into handling this in a separate
controller class, but you may want to revisit this question when you
get the hang of it a bit more).
I would also like to create some seperate outlets for displaying
some float values from some variables of the mydocument class, this
is a similar problems since I don't know where to find the outlets
to connect the GUI elements to.
Do you really mean outlet? Or just an instance variable? While an
outlet is an instance variable, not all instance variables are
outlets...
Still, in either case, just add them to your class definition as above.
At the moment all data is presented in a table using an array
controller. This is fine, but I would like to perform some
calculations on the same data and present the results in a pop-up
window. I guess the method described above should be a nice way to
do this.
Well, see how you go. Not sure why a separate pop-up window seems such
a good idea, but I guess you're just learning the ropes, so go right
ahead.
hth,
Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden