T.R | Title | User | Personal Name | Date | Lines |
---|
1714.1 | can't depend on backing stroe | TOOLEY::B_WACKER | | Fri Nov 10 1989 10:17 | 13 |
| > I would like to know how I can disable the resizing of an application
> created window created via xlib library calls.
setvalues for XtNnoResize on the shell.
>Every time I resize the window I lose its contents even though I have
>set the backing_store field of the XSetWindowAttributes structure to
>"Always".
Even if backing store were implemented, which it isn't, you still have
to provide your own, because it is NEVER guaranteed. Use the expose
events to redraw or copy from a pixmap duplicate prepared for this
purpose.
|
1714.2 | NorthWestGravity bit_gravity | DECWIN::KLEIN | | Fri Nov 10 1989 11:38 | 20 |
| Since you're doing the XCreateWindow yourself, you should be setting
bit_gravity to NorthWestGravity. The default, ForgetGravity, is what
is causing your window to be completely cleared and exposed whenever
it is resized.
Thus, if you wanted to preserve resize capability, you could specify
NorthWestGravity for bit_gravity on the XCreateWindow, and you would
then only get Expose events when the window is made larger, and then
only for the newly exposed regions.
Note that there is a bug (?) in the server that causes ForgetGravity bit_gravity
in any window to propagate (override) the bit_gravity in any of its children.
This is especially noticable with the MOTIF window manager, since MWM
uses ForgetGravity in the frame around your application, effectively
counteracting the benefits of using bit_gravity in your own window.
DECWINMGR was fixed for V1 to avoid this problem.
But anyway...
-steve-
|
1714.3 | De-pravity or bit_gravity ??? | WPOMM2::ZAMBOTTI | | Mon Nov 13 1989 21:36 | 15 |
| Thanks,
I'm not to sure what you mean by the second half of your reply (.2) but
the gravity issue is most kindly accepted.
But still is there away to disable the resizing button. I'm am not
using X toolkit just X lib so the function you mentioned in (.1) isn't
any good to me.
p.s. the application is several hundred thousand lines of fortran code
long and already is written to use a simple graphics routines. I
cannot rewrite this foreign application to use the nicities of X
toolkit unfortunately.
Walter Zambotti.
|
1714.4 | Here's another "hint" | DECWIN::KLEIN | | Tue Nov 14 1989 10:58 | 48 |
| Here are some "hints" on how to disable the resize (and other) buttons
when using the DECwindows window manager. You need to use the DEC_WM_HINTS
property.
>>Assume the following have been initialized:
static Display dpy; /* display ID */
static Window win; /* top level window */
>>Get the atom name (once per display, please):
static int decWmHintsAtom = XInternAtom (dpy, "DEC_WM_HINTS", 0);
>> Set the attributes in the hints structure. Any attributes you do not
>> explicitly set will revert to their default values!
{
DECWmHintsRec decHints;
decHints.no_iconify_button = 1;
decHints.no_resize_button = 1;
decHints.no_lower_button = 1;
decHints.value_mask =
(DECWmNoIconifyButtonMask
| DECWmNoResizeButtonMask
| DECWmNoLowerButtonMask);
XChangeProperty (dpy, win, decWmHintsAtom,
decWmHintsAtom, 32, PropModeReplace, &decHints,
sizeof (DECWmHintsRec) / 4);
}
This is "semi-supported", and there are quite a few "gotchas", the most
serious of which is that omitted property fields are changed to their default
values when one would hope that they would be left alone. This means
that you should send down a complete hints property each time you change
it. Keep a (static) copy of the hints structure in your application
for each top level window. Another "gotcha" is that this is a DEC extension.
The MOTIF window manager interface is different.
Another thing to watch out for is that if you post a "confusing" hints
property, the window manager is likely to crash. It has been quite
easy to confuse the window manager, so be prepared.
Hope this helps. Enjoy.
-steve-
|
1714.5 | She went that a way < ^ v > ... | WPOMM2::ZAMBOTTI | | Thu Nov 16 1989 21:46 | 10 |
| Wow !!!
Yeah what ever. This is going to take me moment/while to digest.
Thanks this is great stuff.
One last question. How did you know all this ? I mean thats amazing.
Bewildered,
Walter Zambotti
|
1714.6 | In trivial pursuit... | DECWIN::KLEIN | | Fri Nov 17 1989 10:59 | 9 |
| >> One last question. How did you know all this ? I mean thats amazing.
Well, thanks. But the real credit goes to the people who wrote this beast.
As to how I came to know all this trivia: I read the toolkit sources.
Cheers.
-steve-
|
1714.7 | Can't get at Window ID | HEIDI::MACKENZIE | | Fri Jan 12 1990 09:28 | 44 |
|
Since I an a veritable novice at DW, please bear with me. I have read notes
125, 1499, 1559, 1714, etc, etc, etc...
I am having a problem getting a valid window ID. I keep getting a window ID
value of zero. Here is an abbreviated piece of code...any help would be
most appreciated.
Regards (and thanks),
Chris
/*
** Begin here...
*/
int main (argc, argv)
unsigned int argc;
char **argv;
{
Arg args[10];
int i;
Display *dpy;
Widget toplevel, main, foo;
Window toplvl;
toplevel = XtInitialize ( "FOO", " ", NULL, 0, &argc, argv );
dpy = XtDisplay ( toplevel );
i=0;
XtSetArg ( args[i], XtNwidth, 1000 ); i++;
XtSetArg ( args[i], XtNheight, 860 ); i++;
main = DwtDialogBoxCreate ( toplevel, "", args, i );
foo = XtParent ( mainwindow );
toplvl = XtWindow ( foo );
.
.
.
}
|
1714.8 | Realize == window | DECWIN::KLEIN | | Fri Jan 12 1990 09:50 | 3 |
| Window IDs are not assigned until a widget is REALIZED.
-steve-
|
1714.9 | | HEIDI::MACKENZIE | | Fri Jan 12 1990 10:18 | 3 |
| Thanks Steve...that makes sense now!
CCM
|