Sha256: 8f3273eac6cd30b34ffba81b972b3bdc5e9ab7b57b904a4790dde436f2362b59

Contents?: true

Size: 847 Bytes

Versions: 151

Compression:

Stored size: 847 Bytes

Contents

=begin
  keyboard_grab.rb - Gdk::Window#keyboard_grab/ungrab sample script.

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

  $Date: 2006/06/17 13:18:12 $
  $Id: keyboard_grab.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $
=end

require "gtk3"

window = Gtk::Window.new("Keyboard Grab/Ungrab sample")

button1 = Gtk::Button.new(:label => "Grab Keyboard!")
button2 = Gtk::Button.new(:label => "Ungrab Keyboard!")

button1.signal_connect("clicked") do
  Gdk.keyboard_grab(window.window, true, Gdk::CURRENT_TIME)
end

button2.signal_connect("clicked") do
  Gdk.keyboard_ungrab(Gdk::CURRENT_TIME)
end

vbox = Gtk::Box.new(:vertical, 0)
vbox.add(button1)
vbox.add(button2)
window.add(vbox)
window.set_default_size(200, 100)
window.show_all
window.signal_connect("destroy") { Gtk.main_quit }

Gtk.main

Version data entries

151 entries across 143 versions & 2 rubygems

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