Sujet : Re: proper way to get Shell widget resized calls?
De : wbe (at) *nospam* UBEBLOCK.psr.com.invalid (Winston)
Groupes : comp.windows.xDate : 15. Jul 2025, 05:34:46
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <yd4ivevzq1.fsf@UBEblock.psr.com>
References : 1 2
User-Agent : Gnus/5.13 (Gnus v5.13)
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
“window” and a “widget”. 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 can’t 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.
Again, I'd like to get notifications (in the generic sense, not
necessarily the strict X11 sense) of resize changes to the application's
Shell widget without having to create another widget just to have a
ClassRec->resize function that I can set. ISTM that something akin to
XtAddCallback (shellwidget, XtNresize, myfunc, cldata)
[but it's not clear that would work: myfunc would need to be an
(XtCallbackProc), not an (XtWidgetProc) which the resize function
normally is; I can adapt myfunc easily enough, but the X11 code that
calls the resize function expects an (XtWidgetProc) [1 argument] and
might not like an (XtCallbackProc) [3 arguments]]
or that adding myfunc to some *_hook list would be the "X11 way" rather
than just setting
applicationShellClassRec.CoreClassPart.resize = myfunction
eliminating the function call that's already there.
Or I may be confused ...
-WBE