Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 23 |
Nodes: | 6 (0 / 6) |
Uptime: | 54:09:57 |
Calls: | 583 |
Files: | 1,139 |
D/L today: |
179 files (27,921K bytes) |
Messages: | 111,699 |
However, I'd like to have a Resize function that gets called when the application window resizes, without having to create a widget just to
have Resize() called.
However, I'd like to have a Resize function that gets called when the
application window resizes, without having to create a widget just to
have Resize() called.
At the lowest level, there is no fundamental distinction in X11 between a i#windowi# and a i#widgeti#. So if you can attach a handler for a particular message to one, you should be able to do the same to the other. Any reason why you cani>t would be down to limitations of your GUI toolkit, not X11 itself.
XtAddCallback (shellwidget, XtNresize, myfunc, cldata)
I originally asked:
However, I'd like to have a Resize function that gets called when
the application window resizes, without having to create a widget
just to have Resize() called.
to which Lawrence D'Oliveiro <ldo@nz.invalid> kindly replied:
At the lowest level, there is no fundamental distinction in X11
between a rCLwindowrCY and a rCLwidgetrCY. So if you can attach a handler
for a particular message to one, you should be able to do the same
to the other. Any reason why you canrCOt would be down to limitations
of your GUI toolkit, not X11 itself.
Ah, I wasn't careful enough in my wording: I was using "window" in
the window manager sense, not in the X11 Widget+Window object sense.
However, I'd like to have a Resize function that gets called when the application window resizes, without having to create a widget just to
have Resize() called.
What's a proper way to do that?
However, I'd like to have a Resize function that gets called when the
application window resizes, without having to create a widget just to
have Resize() called.
What's a proper way to do that?
Found it: one good way is by adding a "<ResizeRequest>: action()" X11 translation. The XtActionProc is passed the (XResizeRequestEvent*) with
the new width and height as the (XEvent*) argument.
By contrast, with ConfigureNotify the regular resize code is still run^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
and the translation action is called when the width or height changes,
but not when the window is just moved.