Re: Wait Cursor Question
[email protected] Fri, 12 May 2023 08:52:27 -0500
| Newsgroups | gmane.comp.lib.fox-toolkit.user |
|---|---|
| Message-ID | <[email protected]> |
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