/* * COPYRIGHT NOTICE * Copyright (c) 1997 Integrated Computer Solutions * * hourCursor / sample.c - sample code to put up an hourGlass cursor */ #include #include #include #include "hourCursor.h" /****************************************************************************** * * * Busy - our XmNdbBusyCallback handler. The busy callback is useful * * for setting an hourglass cursor during a DBMS operation. * * * ******************************************************************************/ static void Busy(w, client, call) Widget w; XtPointer client; XtPointer call; { XiDBDataSourceNotifyCallbackStruct *ns = (XiDBDataSourceNotifyCallbackStruct *) call; /* Verify the reason is right */ if(ns->reason != XiDB_NOTIFY_BUSY) return; /* subreason: 0 for operation over, * non-zero for operation starting */ HourGlass_SetShellCursorHierarchy(AppShell, ns->subreason); XSync(XtDisplay(AppShell), False); } ... When you create your Database Access widget Widget theDB, parent; ... theDB = XtVaCreateWidget("theDB", xiDBSybaseDataSrcWidgetClass, parent, NULL); /* Track DBMS operations so we can put up an hourglass cursor */ XtAddCallback(theDB, XmNdbBusyCallback, Busy, (XtPointer) 0); ...