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> :

Hi,

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

class Hourglass {
public:
Hourglass() // constructor, displays hourglass
{
fl_set_cursor(fl_winget(), XC_watch);
XFlush(fl_get_display());
}

~Hourglass() // destructor, resets cursor
{
fl_reset_cursor(fl_winget());
}

}; // 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?

TIA,
Sindre
(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
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/