XForms: Hourglass: A tip and a question

Sindre Mehus (mehus@darmstadt.gmd.de)
Thu, 10 Jul 1997 16:35:09 +0200

To subscribers of the xforms list from Sindre Mehus <mehus@darmstadt.gmd.de> :


I use the following "trick" to change the cursor to an hourglass. In
C++ I define the following class:

class Hourglass {
Hourglass() // constructor, displays hourglass
fl_set_cursor(fl_winget(), XC_watch);

~Hourglass() // destructor, resets cursor

}; // class Hourglass

This is very convenient; if an hourglass should be displayed during a
lengthy routine I simply create an automatic variable, and that's it.
The constructor will change the cursor to an hourglass, and the
destructor, which is automatically called whenever the routine
terminates, resets the cursor, e.g.:

void callback(FL_OBJECT* obj, long data)
Hourglass h;
// do something ...

Now to the question. From time to time I get the following error:

X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 2 (X_ChangeWindowAttributes)

It doesn't occur very frequently, but sometimes after an
fl_show_alert(). Am I misusing fl_winget() or fl_get_display(), or am I
doing something else hair-raising?

(v0.86, Solaris 2.5.1)

Sindre Mehus                 __     mailto:mehus@darmstadt.gmd.de
GMD-IPSI                    /\_\    http://www.cs.uit.no/~sindrem/
Dolivostr. 15               \/_/    Tel:         +49 6151 869 902
D-64293 Darmstadt, Germany          Fax:         +49 6151 869 966
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/