making editable/clickable a NSTextField inside NSStatusBar
making editable/clickable a NSTextField inside NSStatusBar
- Subject: making editable/clickable a NSTextField inside NSStatusBar
- From: Phillip Moore <email@hidden>
- Date: Sun, 14 Nov 2004 22:03:13 -0500
I posted a few days about about how to get an NSTextField inside the manubar.
I figured that mostly out, at least, I have the text field in the menubar. The problem is
that it is not editable, it shows up, with my sample text but you cannot edit it
or click in it. It is set to 'enabled' and 'editable'.
How I went about getting it in there was to make a subclass of NSView in IB, dropped
a custom view and NSTextField onto it.
If anyone has any hints on how I can get it to be editable or maybe tell me
an alternate way to get the textfield in there that would make it work better I'd
be appreciative.
I also tried adding a mouseDown method to override the one in NSView and NSLog
a message but it never seems to receive the message. Maybe the StatusBar is
not letting messages through?
I have
NSStatusItem *theItem;
- (id)initWithFrame:(NSRect)frameRect
{
if ((self = [super initWithFrame:frameRect]) != nil) {
NSStatusBar *bar = [[NSStatusBar systemStatusBar] retain];
theItem = [bar statusItemWithLength:NSVariableStatusItemLength];
[theItem retain];
[theItem setView:self];
}
return self;
}
-pdm
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden