diff options
Diffstat (limited to 'ext/tk/sample/tkballoonhelp.rb')
-rw-r--r-- | ext/tk/sample/tkballoonhelp.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/ext/tk/sample/tkballoonhelp.rb b/ext/tk/sample/tkballoonhelp.rb index a9bd371db6..a9c00d230d 100644 --- a/ext/tk/sample/tkballoonhelp.rb +++ b/ext/tk/sample/tkballoonhelp.rb @@ -111,12 +111,24 @@ class Tk::RbWidget::BalloonHelp<TkLabel @frame.deiconify @frame.raise - @org_cursor = @parent['cursor'] - @parent.cursor('crosshair') + begin + @org_cursor = @parent.cget('cursor') + rescue + @org_cursor = @parent['cursor'] + end + begin + @parent.configure('cursor', 'crosshair') + rescue + @parent.cursor('crosshair') + end end def erase - @parent.cursor(@org_cursor) + begin + @parent.configure('cursor', @org_cursor) + rescue + @parent.cursor(@org_cursor) + end @frame.withdraw end |