T.R | Title | User | Personal Name | Date | Lines |
---|
119.1 | Just lines | FLUME::dike | | Fri Feb 03 1989 12:15 | 10 |
| Those aren't any kind of widget. Just lines being drawn on the root window.
Your GC needs to have subwindow_mode set to IncludeInferiors, function set to
GXinvert, and plane_mask set to foreground ^ background. I use WhitePixel() and
BlackPixel() for foreground and background.
There are probably other ways of doing rubberbanding, but this is the way dxwm
does it.
Jeff
|
119.2 | Unfortunately, that is a 90% solution, not the whole ball of wax! | DECWIN::FISHER | Burns Fisher 381-1466, ZKO3-4/W23 | Fri Feb 03 1989 16:58 | 27 |
| Please note that there is no perfect solution for doing this (at least not
without being very expensive). Jeff's solution is what most people do, and
it works most of the time. However, it won't work ALL of the time. For example, if you
have an 50% gray pattern like this:
bwbwbwbwbwbwbwbwbw
wbwbwbwbwbwbwbwbwb
bwbwbwbwbwbwbwbwbw
etc, even on a monochrome system, the stretchy box will be nearly invisible
(it just shows up as a slight phase shift). On a color system, if you are
drawing into an area which is not either blackPixel or WhitePixel, there is no
guarantee of what color the result of the masked Invert will be if you are not
drawing over either blackPixel or WhitePixel.
There is only one solution that I know of that will work better.
That is to capture the screen under which you are drawing, draw two
parallel, contrasting lines for each line you want to see. When you move the
line, restore the saved piece of the screen. This has two problems: (1)
it is probably two slow and (2) GetImage or CopyArea (which you would probably
use to save the bits) don't work as you expect if you have multiple depths and
overlapping windows on the screen).
Sigh. Sounds like we need an extension to make the server do the right thing!
Burns
|
119.3 | | CASEE::LACROIX | No future | Mon Feb 06 1989 04:07 | 13 |
| Re .1:
You may want to grab the server to deal with the case where a window
gets scrolled under you ghost rectangle.
Re .2:
Burns is right (of course) in theory. Practically, it works Ok in 99%
cases. A server extension would be nice, but maybe hard to justify
unless the cost of SPRs gets very high...
Denis.
|
119.4 | Be careful with server grabbing | FLUME::dike | | Mon Feb 06 1989 08:50 | 6 |
| It's true that you'll probably want to grab the server during this operation.
However, while debugging, if you accidentally put a breakpoint between the
XGrabServer and XUnGrabServer, you're hosed until you log in from somewhere
else and kill the process that you're debugging.
Jeff
|
119.5 | Thanks ! | USHS09::YARBROUGH | | Thu Feb 09 1989 16:00 | 7 |
|
Thanks for the hints ! You put me on the right track and everything
is working now. Grabbing the server did benefit. When I get a chance
I'll put some example code in the DW_EXAMPLES conference. Until then,
if anyone is interested in seeing the code, send me mail:
USHS09::YARBROUGH.
|
119.6 | | BOOTIS::BAILEY | The Pursuit Of _Knowledge_ | Fri Apr 07 1989 13:29 | 8 |
| Anyone got a (simple) example of the method as used in .1 ?
(I keep winding up with black text on a black window)
Ta
Peb
|