Sha256: 4f1c85bbf39a5c00cc8c65eb0b452c8130eeb63ab70ba62248275d4b20c51fbe

Contents?: true

Size: 825 Bytes

Versions: 116

Compression:

Stored size: 825 Bytes

Contents

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

  Copyright (C) 2001-2006 Masao Mutoh
  Copyright (c) 2002-2015 Ruby-GNOME2 Project Team
  This program is licenced under the same licence as Ruby-GNOME2.
=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::CursorType.values - [Gdk::CursorType::CURSOR_IS_PIXMAP]
cursors -= [Gdk::CursorType::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)
window.show_all

Gtk.main

Version data entries

116 entries across 108 versions & 2 rubygems

Version Path
gtk3-3.0.5-x86-mingw32 sample/misc/cursor.rb
gtk3-3.0.5 sample/misc/cursor.rb
gtk3-3.0.4-x86-mingw32 sample/misc/cursor.rb
gtk3-3.0.4-x64-mingw32 sample/misc/cursor.rb
gtk3-3.0.4 sample/misc/cursor.rb
gtk3-3.0.3-x64-mingw32 sample/misc/cursor.rb
gtk3-3.0.3-x86-mingw32 sample/misc/cursor.rb
gtk3-3.0.3 sample/misc/cursor.rb
gtk3-3.0.2-x86-mingw32 sample/misc/cursor.rb
gtk3-3.0.2-x64-mingw32 sample/misc/cursor.rb
gtk3-3.0.2 sample/misc/cursor.rb
gtk3-3.0.1-x86-mingw32 sample/misc/cursor.rb
gtk3-3.0.1-x64-mingw32 sample/misc/cursor.rb
gtk3-3.0.1 sample/misc/cursor.rb
gtk3-3.0.0-x86-mingw32 sample/misc/cursor.rb
gtk3-3.0.0-x64-mingw32 sample/misc/cursor.rb