Class: Gtk::TwoWindowsExample

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

Overview

Gtk::TwoWindowsExample

Instance Method Summary collapse

Methods inherited from Box

#add_space, #left_aligned_text, #text

Constructor Details

#initializeTwoWindowsExample

#

initialize

#


25
26
27
28
# File 'lib/gtk_paradise/examples/gtk4/087_two_windows_example.rb', line 25

def initialize
  super(:vertical)
  run
end

Instance Method Details

#runObject

#

run

#


33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/gtk_paradise/examples/gtk4/087_two_windows_example.rb', line 33

def run
  w1 = Gtk::Window.new
  w2 = Gtk::Window.new

  w1.set_child(Gtk::Label.new('OK'))
  w1.set_size_request(500, 500)

  button = Gtk::Button.new(label: 'Destroy')
  button.signal_connect(:clicked) {
    w2.destroy
  }
  w2.set_child(button)
  w2.set_size_request(800, 800)
end