Sha256: b61e56230c25549372e123256e944eba07ada938a14266d067bd8fbc2ef57022

Contents?: true

Size: 736 Bytes

Versions: 26

Compression:

Stored size: 736 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.realize

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

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

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

26 entries across 26 versions & 1 rubygems

Version Path
gtk3-2.2.0-x86-mingw32 sample/misc/cursor.rb
gtk3-2.2.0 sample/misc/cursor.rb
gtk3-2.1.0-x86-mingw32 sample/misc/cursor.rb
gtk3-2.1.0 sample/misc/cursor.rb
gtk3-2.0.3-x86-mingw32 sample/misc/cursor.rb
gtk3-2.0.3 sample/misc/cursor.rb
gtk3-2.0.2-x86-mingw32 sample/misc/cursor.rb
gtk3-2.0.2 sample/misc/cursor.rb
gtk3-2.0.1-x86-mingw32 sample/misc/cursor.rb
gtk3-2.0.1 sample/misc/cursor.rb
gtk3-2.0.0-x86-mingw32 sample/misc/cursor.rb
gtk3-2.0.0 sample/misc/cursor.rb
gtk3-1.2.6-x86-mingw32 sample/misc/cursor.rb
gtk3-1.2.6 sample/misc/cursor.rb
gtk3-1.2.5-x86-mingw32 sample/misc/cursor.rb
gtk3-1.2.5 sample/misc/cursor.rb
gtk3-1.2.4-x86-mingw32 sample/misc/cursor.rb
gtk3-1.2.4 sample/misc/cursor.rb
gtk3-1.2.3-x86-mingw32 sample/misc/cursor.rb
gtk3-1.2.3 sample/misc/cursor.rb