• 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
Re: Preventing a NSTextView from drawing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preventing a NSTextView from drawing


  • Subject: Re: Preventing a NSTextView from drawing
  • From: Michael Latta <email@hidden>
  • Date: Mon, 30 Dec 2002 10:03:57 -0800

I would take the text out of the messages into a queue. Then trigger a timer to update the display. This way the screen update is done when the event loop is idle, and there is not problem completing the message passing.

But the bigger problem you have is 2 threads trying to output to the same context. You will need to test the lock availability before trying to update the text, then force a display before releasing the lock.

Is there any way you can place the OpenGL in a separate borderless window that happens to overlap your other window that has the text in it? That would give you separate contexts. It will mean managing the window levels and the like, but it might be much easier.

Michael


On Monday, December 30, 2002, at 09:44 AM, Pierre-Olivier Latour wrote:

Hi,

Is there a way to prevent a NSTextView to redraw itself or mark itself as
reneeding display when you modify its text? I want need to delay its
redrawing actually and call myself [view display];
I tried calling [view setNeedsUpdate:NO] just after editing the text but it
doesn't work.

I know I could probably subclass the text view and patch setNeedsDisplay,
but I was wondering if there is already a clean way to achieve my goal.

More about my problem:

I have a secondary thread which does OpenGL drawing in my app and sometimes
it sends text messages to the main thread through a NSPortMessage.
The main thread gets the message and appends it to a NSTextView.

The problem is that sometimes, if too many messages arrive, some can't be
delivered because in the OpenGL thread, the OpenGL view has been focus
locked and the main thread can't acquire focus on the NSTextView. So it's
waiting for the lock and does not respond to HandlePortMessage


_____________________________________________________________

Pierre-Olivier Latour email@hidden
Palo Alto, USA http://www.pol-online.net
_______________________________________________
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.
_______________________________________________
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.

References: 
 >Preventing a NSTextView from drawing (From: Pierre-Olivier Latour <email@hidden>)

  • Prev by Date: Preventing a NSTextView from drawing
  • Next by Date: Re: SOAP Server
  • Previous by thread: Preventing a NSTextView from drawing
  • Next by thread: NSTableView bug: No scroll bar
  • Index(es):
    • Date
    • Thread