discuss-gnustep
[Top][All Lists]
Advanced

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

NSText and the font panel.


From: Marko Riedel
Subject: NSText and the font panel.
Date: Sun, 26 Feb 2006 01:53:12 +0100 (CET)

Hello there,

I have an NSText object inside a box in a panel which I create like this:

    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 setRichText:YES];
    [fontdisp setUsesFontPanel:YES];
    [fontdisp setDelegate:self];
    [box setContentView:fontdisp];

I cannot get it to change fonts via the set button on the font panel even
though the code is the same as in Ink.app.

I obtained the font menu like this:

[[NSFontManager sharedFontManager] fontMenu: YES].

Oddly enough the menu entries "Bold", "Italic", "Larger" etc. do work and
change the current selection. I just cannot set the font with the set
button. Also, I would like the user only to be able to change the font of
the entire contents of the text object, but when I turn rich text off, the
object stops accepting changes alltogether, or rather, it does not display
them properly. The text is not bold but the menu item reads "unbold."

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]