Re: Wait Cursor Question

Jeroen van der Zijp <[email protected]> Sat, 13 May 2023 15:17:57 -0500
Newsgroups gmane.comp.lib.fox-toolkit.user
Organization FOX Toolkit
Message-ID <[email protected]>
On Sat, 13 May 2023 20:03:55 +0000
Pasquale <[email protected]> wrote:

> ------- Original Message -------
> On Friday, May 12th, 2023 at 1:52 PM, [email protected] <[email protected]> wrote:
> 
> 
> > On 2023-05-12 06:49,
> > 
> > 
> > Pasquale
> > 
> > via Foxgui-users wrote:
> >   
> > > I have an FXTable with "SEL_SELECTED" which calls a function to
> > > display an image. For unsupported images, such as HEIC/HEIF, I convert
> > > them to PNG. This can take a little bit for large images.
> > > 
> > > I want to display the wait cursor and use
> > > this->getApp()->beginWaitCursor() at the start of my function, but it
> > > never activates. It stays a regular mouse and the gui is frozen until
> > > the image conversion and loading happens.
> > > 
> > > I use the beginWaitCursor() and endWaitCursor() in other places
> > > throughout my program and they always work, but for some reason, I
> > > can't get it to work for the function associated with SEL_SELECTED.
> > > 
> > > I'm assuming it is something to do with the gui locking before my call
> > > to beginWaitCursor, but I can't figure out where to put the wait
> > > cursor call or how to force the wait cursor switch before the gui
> > > locks. The status bar also doesn't update which why I assume the gui
> > > is locking before these calls.
> > > 
> > > Any help or insight would be greatly appreciated.  
> > 
> > 
> > The "wait cursor" is a special cursor glyph that replaces the
> > normal cursor for the windows while a lengthy task is being
> > performed.
> > 
> > I think what's happening is that the SEL_SELECTED is issued while
> > the mouse is still grabbed.
> > 
> > After beginWaitCursor(), we've temporarily replaced the normal
> > cursors, but not the grab cursors. So you're still seeing
> > the current grab cursor.
> > 
> > Its possible for me to fix beginWaitCursor() to also change the
> > grab cursor [I believe this is possible, but not 100% sure until
> > I check].
> > 
> > In the meantime, it could be said doing a long-running callback
> > while the cursor is grabbed is not ideal: as the other apps on
> > your desktop will be deprived from any mouse-interaction.
> > 
> > 
> > Regardless, I do believe I should see if the grab-cursor can also
> > be replaced in a beginWaitCursor()-endWaitCursor() interval. That
> > stands to reason.
> > 
> > 
> > Regards,
> > -- JVZ  
> 
> 
> Thank you so much for the information.. When I am in the SEL_SELECTED function, I called table->ungrab() and it gets the normal cursor back, so then i call beginWaitCursor(), perform my long oepration, and then endWaitCursor() when it's done and it works.


Next drop of FOX will, by the way, have the drag-cursor also changed/restored in
beginWaitCursor() / endWaitCursor().

Currently running with this change, and everything seems to work fine thus far.


     -- JVZ