Re: X-windows: changing cursor from and AST ?
From: Bob Gezelter (gezelter_at_rlgsc.com)
Date: 03/31/05
- Next message: Ron Atkinson: "Zero IOSB status"
- Previous message: JF Mezei: "Re: non-US-ASCII characters in mail headers"
- In reply to: JF Mezei: "X-windows: changing cursor from and AST ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 31 Mar 2005 02:33:21 -0800
JF Mezei wrote:
> In an application which has a function which can either be instant or
> take a long time depending on size and type of contents, I'd like to
be
> able to trigger a busy X-windows cursor only if it is to take a
certain
> amount of time.
>
> Since the loop is outside the X-events main loop, and since it
usually
> executes rather quickly, would it be possible (knowing that the loop
> itself does not generate any X-windows updates to the display) to
have
> an AST triggered by a timer say one second after start of loop to
change
> the cursor to a busy cursor ?
> (and possibly update cursor every second).
>
> When the loop completes, it simply cancels the timer and then reverts
> the cursor back to normal.
>
> If the loop performs some windows functions, would it be just a case
of
> canceling AST delivery before you make a call to an X function (and
> re-activating it later) ?
JF,
Since you are running most of the loop in process level, this is one of
the rare times when the old [generally bad] example of how to use an
AST is appropriate.
Request a TIMER operation, with an AST and a AST Parameter that points
to a data structure. When the AST fires, flip a flag that specifies the
cursor style.
To maximize cleanliness, there are two approaches:
- as you mentioned, cancel the timer request, but you must be careful,
you can create a race condition if you are not careful
- the approach I prefer, is to manage some form of event number, and a
table as the AST parameter. Then you can arrange things to that the
timer is not canceled, but does not produce any changes if it is no
longer relevant. This avoids the possibility of a race condition.
I hope that the above is helpful.
- Bob Gezelter, http://www.rlgsc.com
- Next message: Ron Atkinson: "Zero IOSB status"
- Previous message: JF Mezei: "Re: non-US-ASCII characters in mail headers"
- In reply to: JF Mezei: "X-windows: changing cursor from and AST ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: X-windows: changing cursor from and AST ?
... > able to trigger a busy X-windows cursor only if it is to take a certain ...
> Since the loop is outside the X-events main loop, ... X11 routines are not
AST reentrant. ... (comp.os.vms) - RE: Oracle cursor help
... rids dbms_utility.uncl_array; ... where <your where clause> ...
Subject: Re: Oracle cursor help ... exit the loop: */ ... (perl.dbi.users) - Command object stops prematurely without error?
... However, when run via the ADO Command object, the outer loop Applications ...
Declare cApps CURSOR for Select ApplicationID from UCM_Applications ... (microsoft.public.data.ado) - Re: Calling a SP inside a cursor loop..
... every loop iteration of the cursor. ... Fetch next From EffectiveDate_Cursor
Into @FLD1,@FLD2 ... and If the Fetch stmt is below the begin Stmt, the loop iterations
are ... the proper way to program a cursor loop is: ... (comp.databases.ms-sqlserver) - Re: => Trigger to split Trailer Loads
... I am using a Trigger and a cursor with a while loop, however the recursive behaviour
of the cursor is causing me ... I can successfully copy an order from tblOrders to tblSplitOrders,
duplicating order details and splitting the load into ... Enters LineSplit>0
... (microsoft.public.sqlserver.mseq)