Skip navigation.
 
mlEditing the HUD window text edit question
FROM : CoLo0LoGo
DATE : Sat Jul 22 20:31:52 2006

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];

Related mailsAuthorDate
mlEditing the HUD window text edit question CoLo0LoGo Jul 22, 20:31
mlRe: Editing the HUD window text edit question Uli Kusterer Jul 23, 11:18
mlRe: Editing the HUD window text edit question CoLo0LoGo Jul 23, 22:41