I have been playing around with drag and drop commands. I have all that working, but I want to be able to update controls after the drop has occurred. I've been trying all different things but can't seem to get the Outlets to work.
Here is what I have setup :
I have the left square being an image and the right a NSView; both handle drag and drop without a problem. But I want to say update the button at the top to say something else, or even the NSView on the right the "Label" to change when files are dropped.
Here is the interface :
With the "Label" on the right bound to lbTest.
Then I have the init code like this :
When the code runs, it compiles without warning, the "Label" stays "Label", I would expect it to change to "Test". I never seem to have this problem with any other labels but I often don't do sub-views like this.
Next, I have not been able to figure out ANY way to get the Button to change text except from the main window. I read that there is a way by using properties but I don't see that happening. Any thoughts on this?
Thanks for the help.
Here is what I have setup :

I have the left square being an image and the right a NSView; both handle drag and drop without a problem. But I want to say update the button at the top to say something else, or even the NSView on the right the "Label" to change when files are dropped.
Here is the interface :
Code:
@interface DragDropView : NSView
{
//highlight the drop zone
BOOL highlight;
__weak NSTextField *lbTest;
}
@property (weak) IBOutlet NSTextField *lbTest;
@end
With the "Label" on the right bound to lbTest.
Then I have the init code like this :
Code:
@synthesize lbTest;
- (id) initWithFrame:(NSRect)frameRect
{
NSLog(@"initWithFrame");
self = [super initWithFrame:frameRect];
if (self)
{
NSLog(@"iwfSelf");
[lbTest setStringValue:@"Test"];
[self registerForDraggedTypes:[NSArray arrayWithObjects:
NSColorPboardType, NSFilenamesPboardType, nil]];
}
return self;
}
When the code runs, it compiles without warning, the "Label" stays "Label", I would expect it to change to "Test". I never seem to have this problem with any other labels but I often don't do sub-views like this.
Next, I have not been able to figure out ANY way to get the Button to change text except from the main window. I read that there is a way by using properties but I don't see that happening. Any thoughts on this?
Thanks for the help.