Changeset 821


Ignore:
Timestamp:
Aug 22, 2006, 3:23:00 AM (15 years ago)
Author:
livings124
Message:

different way to set font

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.h

    r818 r821  
    3333   
    3434    NSTimer * fTimer;
     35    NSDictionary * fAttributes;
    3536}
    3637
  • trunk/macosx/MessageWindowController.m

    r820 r821  
    4040        fTimer = [NSTimer scheduledTimerWithTimeInterval: UPDATE_SECONDS target: self
    4141                    selector: @selector(updateLog:) userInfo: nil repeats: YES];
     42        fAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSFont fontWithName: @"Monaco" size: 10],
     43                                                                        NSFontAttributeName, nil];
    4244       
    4345        [[self window] update]; //make sure nib is loaded right away
     
    4951{
    5052    [fTimer invalidate];
     53    [fAttributes release];
     54   
    5155    [super dealloc];
    5256}
     
    9094        if (currentMessage != messages || ![[fTextView string] isEqualToString: @""])
    9195            [[fTextView textStorage] appendAttributedString: [[[NSAttributedString alloc]
    92                                                                 initWithString: @"\n"] autorelease]];
     96                                        initWithString: @"\n" attributes: fAttributes] autorelease]];
    9397       
    9498        int level = currentMessage->level;
     
    105109                            dateWithCalendarFormat: @"%Y-%m-%d %H:%M:%S" timeZone: nil];
    106110        messageString = [[[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"%@ %@ %s",
    107                             dateString, levelString, currentMessage->message]] autorelease];
     111                            dateString, levelString, currentMessage->message] attributes: fAttributes] autorelease];
    108112       
    109113        [[fTextView textStorage] appendAttributedString: messageString];
    110114    }
    111115   
    112     tr_freeMessageList(messages);
    113    
    114     [fTextView setFont: [NSFont fontWithName: @"Monaco" size: 10]]; //find a way to set this permanently
     116    tr_freeMessageList(messages);
    115117   
    116118    if (shouldScroll)
Note: See TracChangeset for help on using the changeset viewer.