Class: Myform::MyFormHolder::EmbeddedFormHolder

Inherits:
Gtk::VBox
  • Object
show all
Defined in:
lib/FormHolder.rb

Instance Method Summary collapse

Constructor Details

#initialize(form_holder) ⇒ EmbeddedFormHolder

Returns a new instance of EmbeddedFormHolder.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/FormHolder.rb', line 12

def initialize(form_holder)
	@form_holder=form_holder
	super()
	buttons=Gtk::HButtonBox.new
	okButton=Gtk::Button.new()
	okButton.set_relief(Gtk::ReliefStyle::NONE)
	okButton.set_image(Gtk::Image.new(Gtk::Stock::APPLY,Gtk::IconSize::SMALL_TOOLBAR)).set_label('ok').signal_connect('clicked'){|c|
		@form_holder.form.apply_changes(@form_holder)
	}
  	buttons.pack_start(okButton)
	buttons.set_layout_style(Gtk::ButtonBox::SPREAD)
	pack_start(@form_holder.form,true,true)
	pack_end(buttons,false,true) unless @form_holder.info? || @form_holder.runmode == "dry" || @form_holder.form.gtk_attribute("ok_button")=="false"
end

Instance Method Details

#formObject



26
27
28
# File 'lib/FormHolder.rb', line 26

def form
	@form_holder.form
end

#holderObject



29
30
31
# File 'lib/FormHolder.rb', line 29

def holder
	@form_holder
end

#update(notifier, pid) ⇒ Object



33
34
35
# File 'lib/FormHolder.rb', line 33

def update(notifier,pid)
	@form_holder.form.update(notifier,pid)
end