Class: Gtk::QuitOnKeypressEvent
- Inherits:
-
Box
- Object
- Box
- Gtk::QuitOnKeypressEvent
show all
- Defined in:
- lib/gtk_paradise/examples/gtk4/204_quit_on_keypress_event.rb
Overview
Instance Method Summary
collapse
-
#initialize(run_already = true) ⇒ QuitOnKeypressEvent
constructor
# === initialize ========================================================================= #.
-
#reset ⇒ Object
# === reset (reset tag) ========================================================================= #.
-
#run ⇒ Object
# === run ========================================================================= #.
-
#title? ⇒ Boolean
(also: #title)
# === title? ========================================================================= #.
Methods inherited from Box
#add_space, #left_aligned_text, #text
Constructor Details
14
15
16
17
18
19
20
|
# File 'lib/gtk_paradise/examples/gtk4/204_quit_on_keypress_event.rb', line 14
def initialize(
run_already = true
)
super(:horizontal)
reset
run if run_already
end
|
Instance Method Details
#reset ⇒ Object
32
33
|
# File 'lib/gtk_paradise/examples/gtk4/204_quit_on_keypress_event.rb', line 32
def reset
end
|
#run ⇒ Object
38
39
40
41
42
43
44
45
46
|
# File 'lib/gtk_paradise/examples/gtk4/204_quit_on_keypress_event.rb', line 38
def run
keycont = Gtk::EventControllerKey.new
keycont.signal_connect(:key_pressed) {|widget, event|
e 'WE WERE PRESSED!'
pp event
}
add_controller(keycont)
set_halign(:center)
end
|
#title? ⇒ Boolean
Also known as:
title
25
26
27
|
# File 'lib/gtk_paradise/examples/gtk4/204_quit_on_keypress_event.rb', line 25
def title?
'Cahnged Events Example'
end
|