discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: NSText and the font panel. (II)


From: Marko Riedel
Subject: RE: NSText and the font panel. (II)
Date: Mon, 27 Feb 2006 12:35:09 +0100 (CET)

Hi folks,

> 
> Hello there,
> 
> when I switched to WindowMaker from KDE I was able to set fonts with the
> font panel and have them display correctly in the NSText object. I would
> still like to be able to let the user edit text attributes but not
> characters. I guess I could do this by overriding cut:, paste: and
> insertText:. Is there an easier way?
> 

I figured it out: changeFont: does the trick:

    fontdisp = [[NSText alloc] initWithFrame:[[box contentView] frame]];
    [fontdisp setString:
      _(@"The quick brown fox jumps over the lazy dog.")];
    [fontdisp setAlignment:NSCenterTextAlignment];
    [fontdisp setFont:[NSFont userFontOfSize:24]];
    [fontdisp setUsesFontPanel:NO];
    [fontdisp setSelectable:NO];
    [box setContentView:fontdisp];

and

- changeFont:(id)sender
{
    NSFont *cfont =
        [[NSFontManager sharedFontManager] convertFont:[fontdisp font]];
    [fontdisp setFont:cfont];
    return self;
}


> BTW why is this list so slow nowadays?
> 

I have also noticed that not only has the list become very slow, it also
seems to send out a number of duplicate messages.

Best regards,

Marko



+-------------------------------------------------------------+
| Marko Riedel, EDV Neue Arbeit gGmbH, markoriedelde@yahoo.de |
| http://www.geocities.com/markoriedelde/index.html           |
+-------------------------------------------------------------+


        

        
                
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de




reply via email to

[Prev in Thread] Current Thread [Next in Thread]