Class: Gtk::ChangedEventsExample
- Inherits:
-
Box
- Object
- Box
- Gtk::ChangedEventsExample
show all
- Defined in:
- lib/gtk_paradise/examples/gtk4/200_changed_events_example.rb
Overview
Gtk::ChangedEventsExample
Instance Method Summary
collapse
-
#initialize(run_already = true) ⇒ ChangedEventsExample
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/200_changed_events_example.rb', line 14
def initialize(
run_already = true
)
super(:horizontal)
reset
run if run_already
end
|
Instance Method Details
#reset ⇒ Object
32
33
34
35
36
37
38
|
# File 'lib/gtk_paradise/examples/gtk4/200_changed_events_example.rb', line 32
def reset
@spinner = ::Gtk::Spinner.new
@spinner.set_spinning(true)
end
|
#run ⇒ Object
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# File 'lib/gtk_paradise/examples/gtk4/200_changed_events_example.rb', line 43
def run
Thread.new {
sleep 0.3 @spinner.set_spinning(true)
}
append(@spinner)
text1 = Gtk::Label.new(
' This is a test. You can click on it via the mouse. '
)
click1 = Gtk::GestureClick.new
click1.signal_connect(:pressed) { e 'The mouse button was clicked.' }
text1.add_controller(click1)
append(text1)
set_halign(:center)
end
|
#title? ⇒ Boolean
Also known as:
title
25
26
27
|
# File 'lib/gtk_paradise/examples/gtk4/200_changed_events_example.rb', line 25
def title?
'Cahnged Events Example'
end
|