sub make_busy($$) { my($instance, $busy) = @_; # Create and store the cursors if we haven't done so already. if (! exists($instance->{busy_cursor})) { $instance->{normal_cursor} = Gtk2::Gdk::Cursor->new("left-ptr"); $instance->{busy_cursor} = Gtk2::Gdk::Cursor->new("watch"); } # Do it. Make the application bar grab the input when the window is # busy, that way we gobble up keyboard and mouse events that could # muck up the application state. if ($busy) { $instance->{window}->window()-> set_cursor($instance->{busy_cursor}); Gtk2->grab_add($instance->{appbar}); } else { $instance->{window}->window()-> set_cursor($instance->{normal_cursor}); Gtk2->grab_remove($instance->{appbar}); } }