• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Rock : Me : Hard Place
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rock : Me : Hard Place


  • Subject: Rock : Me : Hard Place
  • From: Anthony Duer <email@hidden>
  • Date: Thu, 19 Sep 2002 23:06:57 -0700

I've come across quite the enigma as to what the appropriate way to fix a bug in my program is. First, the bug:

In my application I have a main window (NSWindow) which has a NSTextView to display data I read from a socket. Next, I have a secondary palette for the user (NSPanel) which displays data on occasion that isn't required to be displayed in the main window. However, I've come across quite a large bug:

The function that receivs a NSNotification, processes it, and updates the NSPanel with the data doesn't cause the NSPanel to redraw. It will retain the old data until the user clicks the NSPanel, at which point it updates.

The really buggy part is this: if the data processor (it's VERY trivial) is run in a separate NSThread, the NSPanel will update perfectly. However, this bogs down the application as it has to continuously start/stop a NSThread just for .05 seconds of processing time.

So, does anyone know the way to make a NSPanel update itself if it is not key or is the only way to continuously launch a NSThread and hope for the best?

Here's the function:

- (void) updateDir: (NSNotification *)note
{
NSString *dirs = [note object];
int i = 0
for(i = 0; i < [dirs length]; i++)
{
char x = [dirs characterAtIndex: i];
if(x == 'a')
{
[textView1 setStringValue; @"church"];
}
else if(x=='b')
{
[textView2 setStringValue: @"town"];
}
...
}
[dirPanel display];
}

~Anthony Duer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: PB pref to...?
  • Next by Date: RE: Detecting option key with button click
  • Previous by thread: Re: PB pref to...?
  • Next by thread: Bad access when application quits - NSApp terminate
  • Index(es):
    • Date
    • Thread