lib/jldrill/views/gtk/widgets/ProblemPane.rb in jldrill-0.5.1.7 vs lib/jldrill/views/gtk/widgets/ProblemPane.rb in jldrill-0.6.0.1

- old
+ new

@@ -1,5 +1,6 @@ +# encoding: utf-8 require 'Context/Gtk/Widget' require 'gtk2' module JLDrill::Gtk @@ -134,10 +135,23 @@ size = y + height windowType = Gtk::TextView::WINDOW_TEXT winx, winy = @contents.buffer_to_window_coords(windowType, 0, size) return winy end + + def showBusy(bool) + # TextViews have a hidden subwindow that houses the cursor + subwindow = @contents.get_window(Gtk::TextView::WINDOW_TEXT) + if bool + self.window.set_cursor(Gdk::Cursor.new(Gdk::Cursor::WATCH)) + subwindow.set_cursor(Gdk::Cursor.new(Gdk::Cursor::WATCH)) + else + self.window.set_cursor(nil) + subwindow.set_cursor(nil) + end + Gdk::flush() + end end # The pane that displays the question for the problem class QuestionPane < ProblemPane def update(problem) @@ -169,7 +183,8 @@ if !problem.nil? problem.publishAnswer(self) @isClear = false end end + end end