[fxruby-users] Questions on cursors

Jeroen van der Zijp jeroen at fox-toolkit.org
Thu Jul 13 09:15:07 EDT 2006

On Thursday 13 July 2006 07:55, Ronald Pijnacker wrote:
> Hi all,
> Recently I started using FXRuby (on windows) for a prototype 
> visualization package.
> 'Til everything went nice and smooth. Thanks for a nice toolkit.
> One of the things I am trying to do is to map different mousebutton
> combinations to different interactions. To give feedback, I would like
> to update the cursor to indicate the interaction triggered.
> My approach was to enable the wait cursor when the mouse button was
> pressed, and switch wait cursors for different combinations of mouse
> buttons. To see which combination of mouse buttons is pressed, I use the
> event.state property.
> Could you please answer some questions:
> 1. When I press left & middle inside the canvas, move the mouse outside
>    the fx-window and release both buttons, I get only one callback for
>    the RELEASE, eventhough I keep the canvas grabbed. Is this expected?
> 2. Is the beginWaitCursor / endWaitCursor / setWaitCursor the right
>    strategy? I've been playing around with setting the cursors, but I
>    get quite some crashes.
> 3. I've created a different default cursor, which I assign to the
>    DEF_ARROW_CURSOR. When I assign it to DEF_RARROW_CURSOR too, I get a
>    crash during exiting. Am I doing something wrong?
> 4. It seems defaultCursor= is an alias to setDefaultCursor. However,
>    this takes two parameters, which is kindof unexpected for a
>    set-property. Did I misunderstand the meaning of defaultCursor= ?
> Thanks for taking the time to answer my questions.
> Groeten/Regards,

1) If the first RELEASE causes the widget to ungrab(), the second
   RELEASE will go to the widget under the cursor.

2) I'd reserve beginWaitCursor()/endWaitCursor() for situations where
   the GUI is "busy" for a long while, e.g. when reading files.
   If you just want to change the cursor duing a grab, change the
   grab cursor using setDragCursor(), and it will be automatically
   used while the grab is in effect.

3) These are really "stock cursors" and they can be changed only BEFORE
   creating any widgets; when a widget is created, it gets its cursor
   from FXApp; you can use this to install your own custom cursor-theme
   if you need.  It affects ALL widgets.

   Rather than changing FXApp's cursors, I recommend changing the cursor
   of a specific widget only, using setDefaultCursor() and setDragCursor().

4) This is an FXRuby question for Lyle I think; I can only say that in FOX
   itself there's only 1 parameter, the cursor...



| Copyright (C) 23:30 03/30/2006 Jeroen van der Zijp.   All Rights Reserved. |

More information about the fxruby-users mailing list