#Windows
8 messages in this thread
Does anyone know how to change the appearance of a window whose flags you
have changed after it was opened so that its new flag states are reflected.
Like if I open a BACKDROP window and later negate its BACKDROPness in the
Flags field how can I make Intuition recognize this change and act
accordingly. I know that if you do something like change the Title field
all you have to do is call RefreshWindowFrame with the name of the window
and the change wil take affect but this does not seem to work when Flags
are changed.
Scott
Scott,
I believe the BACKDROP flag is only looked at/honored when the window is
opened. Consequently, the only way to do what you want is close the
window, and re-open it with the configuration you desire. You could always
open a second window and then close the first window if you don't want
things to disappear during the transition. (This latter approach would
tend to fragment memory a bit more, however).
Hope this helps…
…BobR
Bob,
You're right. If you look at page D-55 of your ROM Kernel
Reference Manual (1.3) :Includes and AutoDocs (this is the listing of
intuition.h) you'll find that the flags are defined in two sections, FLAGS
that are requested but not directly set and flags that can be directly set.
Check it out, its interesting reading.
Scott
Bob Rakowsky's answer was mostly correct, except that it may be possible to
go underneath the window and goof around with the "layers" of the window.
You can get a pointer to the layer for your window through the RastPort.
window->RPort->Layer->Flags &= ~LAYERBACKDROP; I don't know what effect
this would have because I haven't tried it yet, but you may want to give it
a try if you really must monkey around with that kind of stuff. I usually
try and avoid such fancy tricks, but I don't know your application.
To turn a GIMMEZEROZERO window into a BACKDROP window simply use this code:
window->Flags^=GIMMEZEROZERO; RefreshWindowFrame(window); Forbid();
window->RPort->Layer->Flags|=BACKDROP; Permit(); BehindLayer(window);
window->Flags|=GIMMEZEROZERO; RefreshWindowFrame(window);
and there you have a BACKDROP GIMMEZEROZERO window.
to make the same window back to a normal window again use this:
window->Flags^=GIMMEZEROZERO; RefreshWindowFrame(window); Forbid();
window->RPort->Layer->Flags^=BACKDROP; Permit(); UpfrontLayer(window);
window->Flags|=GIMMEZEROZERO; RefreshWindowFrame(window);
and its back to normal
to use these routines with non-GZZ windows simply leave out the lines that
contain GIMMEZEROZERO and all the RefreshWindowFrame() calls.
The reason the actual change must be done while the window is not in GZZ
mode is that in GZZ mode the window border and what's in the window are in
separate layers.
Scott
Change BehindLayer(window); calls in my previous message to
BehindLayer(dummy,window->RPort->Layer); where dummy has been previously
defined as a LONG and all UpfrontLayer(window) calls to
UpfrontLayer(dummy,window->RPort->Layer) where dummy is same as before. I
made a typo in the previous message, this is the reason for the fix.
Scott
Be careful with those "^=" constructs. They can be dangerous if both sides
are not the same. I always do a "&= ~". Thanks for the information.
Robert
That's not true, using ^= is like using |= or += when that bit
isn't already set and its like using -= if that bit is set. Also, change
the UpfrontLayer(window) calls to UpfrontLayer(dummy,window->RPort->Layer)
where dummy was previously declared as LONG and change BehindLayer(window)
calls to BehindLayer(dummy,window->RPort->Layer) where dummy is same as
above. I don't know what I was thinking about when I wrote that message and
gave those two functions the wrong parameters to pass but now you have all
the right code.
Scott