[Wxruby-users] BusyCursor probs in 0.6

Kevin Smith
2005-04-04T10:26:17Z

David Legard wrote:
> class NothingApp < Wx::App
>   def on_init
>     frame = MyFrame.new("Minimal wxRuby App")
> 	frame.show
> 	BusyCursor.new {
> 	message_box("This is a control sample", "About
Controls")
> 	}
>
>   end
> end
> -----------------------
> However, the message_box line is never executed and the program seems
> to hang. Could somebody advise if I am doing something wrong?

The sequence of this code is unusual, and that might be causing the
problems. You might either:

1. do the BusyCursor and message_box *before* creating the frame, or

2. put the BusyCursor around both the frame.show and the message_box, or

3. move the BusyCursor and message_box inside the MyFrame class

Beyond that, it seems odd to try to have the busy cursor displayed while
a modal dialog (message_box) is showing. A more "fair" test might be
to
put up the busy cursor, and then just sleep for 5 seconds to simulate
some slow non-UI operation taking place.

Unfortunately, I don''t have time right now to actually test and
research
this. Hopefully these guesses will help,

Kevin