[comp.sys.mac.programmer] Window Flickering

d88-jwa@dront.nada.kth.se (Jon W{tte) (01/20/91)

In article <1991Jan20.055545.7162@wpi.WPI.EDU> nuk@wpi.WPI.EDU (Jacob W Anderson) writes:

>I assume that the flicker is from the activation event going on, but is there
>a way to supress the activation event from the event qeue? aka:the equivalent
>of the command key along with drag.

>BEGIN
>  if FrontWindow <> MenuWindow then 
>	BEGIN
>	  BehindWindow:=FrontWindow;
>	  SendBehind(BehindWindow,MenuWindow);
>	  HiliteWindow(BehindWindow);
>	END;
>END;

>This code is ran constantly through my event loop, thus checking for any 
>dragging that the user may do.

This last sentence is the problem : if you DragWindow() it will
automagically bring your window to the front. Try implementing
your own DragWindow ( using DragGrayRgn ) and have it SendBehind
the window being dragged unless the cmd key is down.

Generally, these kinds of things are better handled once (i.e.
at dragging time) than in the event loop (like, looking for errors
and correcting them afterwards)

								h+

Jon W{tte, Stockholm, Sweden, h+@nada.kth.se
:: This article is fake. If you take it for real, the _REAL_
:: Jon W{tte will sue you for slander. So there ! Nyah ! :-)

Lawson.English@p88.f15.n300.z1.fidonet.org (Lawson English) (01/21/91)

Jacob W Anderson writes in a message to All

JWA> I am making a program that requires a window to be in the front 
JWA> at all times, I realize that this is probably not Apple standard. 
JWA> 
JWA> My problem is that when I overlap any windows on this frontmost 
JWA> window, it does all kinds of flickering, but if you hold down 
JWA> the command key while you drag the windows, it does not flicker. 

I don't know why you don't get flickering, but the TCL's have a special Floating
Window Class in the "More Classes" folder and the ArtClass example uses it.
Check out ArtClass, and see if the Pallettes it uses are what you need, if so,
look at the source code, and cut'n'paste...


Lawson
 

--  
Uucp: ...{gatech,ames,rutgers}!ncar!asuvax!stjhmc!300!15.88!Lawson.English
Internet: Lawson.English@p88.f15.n300.z1.fidonet.org