FROM : Rohit Bhatia
DATE : Tue Mar 29 11:51:44 2005
Hi,
You are right, I want to display undetermined number of images. I was
able to create NSImageViews at run time after some tweaking to my code.
Now, when my initWithFrame function is called, I store the reference to
my main View. Later on (upon an action) I add a new NSImageView as a
subview to the main one. I haven't used the NIB file for it, I just
created it as just another object, is there any difference if I use the
NIB file for it?
This is how I am storing a reference to my Main View right now.
- (id)initWithFrame:(NSRect) frameRect
{
myMainImageView = self;
}
It works fine, is there a better method to do it (may be the NIB file).
Later on, on an action, I add subviews to this main view.
Thanks for the help.
Rohit
-----Original Message-----
From: Anish Kumar [mailto:<email_removed>]
Sent: Tuesday, March 29, 2005 10:20 AM
To: Rohit Bhatia; <email_removed>
Subject: RE: Creating controls dynamically (Rohit Bhatia)
Hi,
Your code seems to show that you want to display undetermined number of
images during runtime. I feel the best way to do this is to use a
seperate nib file with a instantiated object which is a sub-class of
NSView(or NSImageView).
You can then load the nib file as and when you want and set an image of
your choice to the sub-class of NSView on the nib file. After loading
and setting the image you can add that sub-class of NSView as a sub-view
of your main view.
Try this and if you face any problem implementing this mail me back.
regards,
-Anish
http://www.qubyx.com/
DATE : Tue Mar 29 11:51:44 2005
Hi,
You are right, I want to display undetermined number of images. I was
able to create NSImageViews at run time after some tweaking to my code.
Now, when my initWithFrame function is called, I store the reference to
my main View. Later on (upon an action) I add a new NSImageView as a
subview to the main one. I haven't used the NIB file for it, I just
created it as just another object, is there any difference if I use the
NIB file for it?
This is how I am storing a reference to my Main View right now.
- (id)initWithFrame:(NSRect) frameRect
{
myMainImageView = self;
}
It works fine, is there a better method to do it (may be the NIB file).
Later on, on an action, I add subviews to this main view.
Thanks for the help.
Rohit
-----Original Message-----
From: Anish Kumar [mailto:<email_removed>]
Sent: Tuesday, March 29, 2005 10:20 AM
To: Rohit Bhatia; <email_removed>
Subject: RE: Creating controls dynamically (Rohit Bhatia)
Hi,
Your code seems to show that you want to display undetermined number of
images during runtime. I feel the best way to do this is to use a
seperate nib file with a instantiated object which is a sub-class of
NSView(or NSImageView).
You can then load the nib file as and when you want and set an image of
your choice to the sub-class of NSView on the nib file. After loading
and setting the image you can add that sub-class of NSView as a sub-view
of your main view.
Try this and if you face any problem implementing this mail me back.
regards,
-Anish
http://www.qubyx.com/
| Related mails | Author | Date |
|---|---|---|
| Rohit Bhatia | Mar 29, 11:51 | |
| Anish Kumar | Mar 30, 08:09 | |
| j o a r | Mar 30, 08:43 | |
| Anish Kumar | Mar 30, 09:04 | |
| j o a r | Mar 30, 09:21 |






Cocoa mail archive

