How to detect the event of minimizing window.

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
How to detect the event of minimizing window.

Submitted by CJZHANG on Tue, 04/15/2003 - 22:58.

Hi Folks,

I am writing an application, which I hope it acts in this
way the main window holds a canvas, all draw actions draw pixmap to this canvas. I want when the window is minimized,
all draw actions will stop, when the window is visible, the application will continue the draw actions.

I tries almost all event masks I think related to window minimization e.g. ExposureMask, VisibilityChangeMask, but
the application still can not catch this event.

If anyone has any idea, please let me know.
Thank you in advance.

CJ Zhang

Wed, 04/16/2003 - 00:17#1

Wed, 04/16/2003 - 00:17#1

ICS_support

How to detect the event of minimizing window.

Is the application drawing on its own, without user input? If so, yes, you want to check Visibility events. Xt is also clever about tracking this information for widgets, so one way to handle this is to subclass XmDrawingArea to set the widget class preferences to track visibility, and then make a public function the application can check before drawing. See, for example, the various clock widgets out there, which are clever enough not to draw when they are not visible.