Editing the HUD window text edit question
Editing the HUD window text edit question
- Subject: Editing the HUD window text edit question
- From: CoLo0LoGo <email@hidden>
- Date: Sat, 22 Jul 2006 14:31:52 -0400
So I am poking in the HUD window from
http://mattgemmell.com/2006/03/12/hudwindow
And I get as far as getting it to let me select text and rightclick to
copy and paste text to change it's contents but I can not get it to
just let me select the text like a normal text editing program and
type in normal content.
Note how do I use the options that do not have (void)'s and have the
BOOL on the left of the method like so
//[textField YES:allowsEditingTextAttributes];
Since
– setSelectable:
– isSelectable
look the same but only setSelectable works
My code block
// Create a HUDWindow.
// Note: the styleMask is ignored; NSBorderlessWindowMask is always used.
window = [[HUDWindow alloc] initWithContentRect:windowFrame
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO];
// Add some text to the window.
float textHeight = 300.0;
NSTextField *textField = [[NSTextField alloc]
initWithFrame:NSMakeRect(0.0, (windowSize.height / 2.0) - (textHeight
/ 2.0),
windowSize.width, textHeight)];
[[window contentView] addSubview:textField];
[textField setAllowsEditingTextAttributes:YES];
//[textField YES:allowsEditingTextAttributes];
//[textField YES:isSelectable];
//[textField YES:isEditable];
[textField setEditable:YES];
[textField setSelectable:YES];
[textField setTextColor:[NSColor whiteColor]];
[textField setDrawsBackground:NO];
[textField setBordered:NO];
[textField setAlignment:NSCenterTextAlignment];
[textField setStringValue:@" icfsf Some sample text"];
[textField release];
_______________________________________________
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