discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSTextField


From: Stefan Böhringer
Subject: Re: NSTextField
Date: 28 Jun 2002 08:50:11 +0200

It might be prudent if you do extensive view manipulation which may
potentially span several iterations of the runloop to remove a superview
from the views being manipulated from the view hierarchy. Then you do
your manipulation and readd the removed view afterwards.

Best wishes,

        Stefan

On Thu, 2002-06-27 at 17:04, David.Ayers@brainag.com wrote:
> Hello All,
> 
> Back to NSTextField's selectText: the DO call to the PasteBoardServer,
> _handleWindowNeedsDisplay: and NSRunLoops's
> performSelector:target:argument:order:modes:
> 
> I've spent a couple more days pondering which way to go. In NSApplication's 
> run
> method, it poll's the events using it's
> nextEventMatchingMask:untilDate:inMode:deque method and then redisplays it's
> windows through it's updateWindows method. Therefore the
> _handleWindowNeedsDisplay: which is setup through a
> performSelector:target:argument:order:modes: in NSViews setNeedsDisplayInRect:
> (or rather in NSWindow's setViewsNeedsDisplay:) is more of a failsafe method 
> of
> displaying the views if the runloop is rerun during the sendEvent:  
> invocation.
> 
> Now this might very well be necessary, but maybe it would be better instead to
> call displayIfNeeded only when its absolutly necessary. Considering the
> sepration of "View Manipulation" and "Display", this "Display" should be 
> avoided
> upon rerun of the runloop, if we are still in "View Manipulation". Yet the 
> rerun
> could be invoked at an arbitrary time like the DO message to the pbs-Server
> does, causing the displayIfNeeded to be invoked.
> 
> On the otherhand maybe using an lock/unlock mechanism per window for 
> displaying
> might be the better solution. (A flag (or counter for reentrancy) to be set
> (incremeted) and cleared (decremented) during a "view manipulation 
> transaction"
> And allow displayIfNeeded only to do its thing if this flag is clear (the
> counter is 0)).
> 
> I shortly considered configuring the connection to the PBS-Server to run in
> NSConnectionReplayMode but this would only postpone the problem to a user
> configured connection. (maybe even causing reentrancy problems for the
> PBS-Server)
> 
> I'm still not sure but maybe some one will give thier 2 cents to it.





reply via email to

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