Class: Gtk::Box

Inherits:
Object
  • Object
show all
Defined in:
lib/gtk_paradise/core_classes/box.rb

Overview

This is specifically for gtk3 and gtk4.

Instance Method Summary collapse

Instance Method Details

#add_spaceObject

#

add_space

This is, ultimately for now, just a vertical “spacer”. At a later time we may have to query the orientation of the box, but for now it just sufficed for my use case to define it as vertical.

#


51
52
53
# File 'lib/gtk_paradise/core_classes/box.rb', line 51

def add_space
  ::Gtk.vertical_spacer
end

#left_aligned_text(i, padding_to_use = 2) ⇒ Object

#

left_aligned_text

#


36
37
38
39
40
41
42
# File 'lib/gtk_paradise/core_classes/box.rb', line 36

def left_aligned_text(
    i, padding_to_use = 2
  )
  text = ::Gtk::Label.new(i)
  text.left_align
  minimal(text, padding_to_use)
end

#text(i, padding_to_use = 2) ⇒ Object

#

text

#


27
28
29
30
31
# File 'lib/gtk_paradise/core_classes/box.rb', line 27

def text(
    i, padding_to_use = 2
  )
  minimal(::Gtk::Label.new(i), padding_to_use)
end