Class: Gtk::ChangedEventsExample

Inherits:
Box
  • Object
show all
Defined in:
lib/gtk_paradise/examples/gtk4/200_changed_events_example.rb

Overview

Gtk::ChangedEventsExample

Instance Method Summary collapse

Methods inherited from Box

#add_space, #left_aligned_text, #text

Constructor Details

#initialize(run_already = true) ⇒ ChangedEventsExample

#

initialize

#


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

#resetObject

#

reset (reset tag)

#


32
33
34
35
36
37
38
# File 'lib/gtk_paradise/examples/gtk4/200_changed_events_example.rb', line 32

def reset
  # ======================================================================= #
  # === @spinner
  # ======================================================================= #
  @spinner = ::Gtk::Spinner.new
  @spinner.set_spinning(true)
end

#runObject

#

run

#


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 # Just to show how to activate it, via a slight delay.
    @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

#

title?

#

Returns:

  • (Boolean)


25
26
27
# File 'lib/gtk_paradise/examples/gtk4/200_changed_events_example.rb', line 25

def title?
  'Cahnged Events Example'
end