Class: Builder::Gtk::BoxProxy

Inherits:
Object
  • Object
show all
Includes:
LayoutProxy
Defined in:
lib/proxies/box.rb

Overview

Proxies both VBox and HBox

Instance Attribute Summary

Attributes included from LayoutProxy

#widget

Instance Method Summary collapse

Methods included from LayoutProxy

#method_missing

Constructor Details

#initialize(widget) ⇒ BoxProxy

Creates a new proxy for the given VBox or HBox widget The default packing is @pack_start(widget, false, false, 0)@.



12
13
14
15
16
17
18
# File 'lib/proxies/box.rb', line 12

def initialize(widget)
  @widget = widget
  @data = {
    :position => :start,
    :args => [false, false, 0],
  }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Builder::Gtk::LayoutProxy

Instance Method Details

#end(*args, &block) ⇒ Object

Sets the pack mode to pack_end The arguments are passed to pack_end for every following widget definition.



30
31
32
# File 'lib/proxies/box.rb', line 30

def end(*args, &block)
  return _pack(:end, args, block)
end

#start(*args, &block) ⇒ Object

Sets the pack mode to pack_start. The arguments are passed to pack_start for every following widget definition.



23
24
25
# File 'lib/proxies/box.rb', line 23

def start(*args, &block)
  return _pack(:start, args, block)
end