Sha256: 1afc10feec5167de033d0aec8dbed2ced590a0de6b92094505fa6a54b43037da

Contents?: true

Size: 802 Bytes

Versions: 35

Compression:

Stored size: 802 Bytes

Contents

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

  Copyright (C) 2001-2006 Masao Mutoh
  Copyright (c) 2002-2020 Ruby-GNOME Project Team
  This program is licenced under the same licence as Ruby-GNOME.
=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] -
          [Gdk::CursorType::LAST_CURSOR]
cursors = cursors.cycle

button.signal_connect('clicked') do
  cursor = cursors.next
  p cursor
  button.set_label(cursor.inspect)
  window.window.set_cursor(Gdk::Cursor.new(cursor))
end

window.add(button)
window.set_default_size(400, 100)
window.show_all

Gtk.main

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
gtk3-4.2.4 sample/misc/cursor.rb
gtk3-4.2.3 sample/misc/cursor.rb
gtk3-4.2.2 sample/misc/cursor.rb
gtk3-4.2.1 sample/misc/cursor.rb
gtk3-4.2.0 sample/misc/cursor.rb
gtk3-4.1.9 sample/misc/cursor.rb
gtk3-4.1.8 sample/misc/cursor.rb
gtk3-4.1.7 sample/misc/cursor.rb
gtk3-4.1.6 sample/misc/cursor.rb
gtk3-4.1.5 sample/misc/cursor.rb
gtk3-4.1.4 sample/misc/cursor.rb
gtk3-4.1.3 sample/misc/cursor.rb
gtk3-4.1.2 sample/misc/cursor.rb
gtk3-4.1.1 sample/misc/cursor.rb
gtk3-4.1.0 sample/misc/cursor.rb
gtk3-4.0.9 sample/misc/cursor.rb
gtk3-4.0.8 sample/misc/cursor.rb
gtk3-4.0.7 sample/misc/cursor.rb
gtk3-4.0.6 sample/misc/cursor.rb
gtk3-4.0.5 sample/misc/cursor.rb