Sha256: aaff7f4e06f8391149d4af7096390f0dc73472894a10cf378d54786fb2ed2495

Contents?: true

Size: 829 Bytes

Versions: 12

Compression:

Stored size: 829 Bytes

Contents

=begin
  cursor.rb - Gdk::Cursor sample script.

  Copyright (C) 2001-2006 Masao Mutoh
  This program is licenced under the same licence as Ruby-GNOME2.

  $Id: cursor.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $
=end

require "gtk3"

window = Gtk::Window.new("Gdk::Cursor sample")
window.signal_connect('destroy') {Gtk.main_quit}
window.realize

button = Gtk::Button.new(:label => "Click!")
button.use_underline = false

cursors = Gdk::Cursor::Type.values - [Gdk::Cursor::Type::CURSOR_IS_PIXMAP]
cursors -= [Gdk::Cursor::Type::LAST_CURSOR]

cnt = 0
button.signal_connect('clicked') do
  cursor = cursors[cnt]
p cursor.inspect
  button.set_label(cursor.inspect)
  window.window.set_cursor(Gdk::Cursor.new(cursor))
  cnt += 1
  cnt = 0 if cnt == cursors.size
end
window.add(button)
window.set_default_size(400,100).show_all

Gtk.main

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gtk3-2.2.5-x64-mingw32 sample/misc/cursor.rb
gtk3-2.2.5-x86-mingw32 sample/misc/cursor.rb
gtk3-2.2.5 sample/misc/cursor.rb
gtk3-2.2.4-x64-mingw32 sample/misc/cursor.rb
gtk3-2.2.4-x86-mingw32 sample/misc/cursor.rb
gtk3-2.2.4 sample/misc/cursor.rb
gtk3-2.2.3-x86-mingw32 sample/misc/cursor.rb
gtk3-2.2.3 sample/misc/cursor.rb
gtk3-2.2.2-x86-mingw32 sample/misc/cursor.rb
gtk3-2.2.2 sample/misc/cursor.rb
gtk3-2.2.1-x86-mingw32 sample/misc/cursor.rb
gtk3-2.2.1 sample/misc/cursor.rb