Class: Qt::Dialog

Inherits:
Object show all
Includes:
Layoutable
Defined in:
lib/rui/toolkits/qt/qt.rb

Instance Attribute Summary

Attributes included from Layoutable

#main_layout, #owner

Instance Method Summary collapse

Methods included from Layoutable

#add_accessor, #add_layout, #add_widget, #buddies

Instance Method Details

#setGUI(gui) ⇒ Object



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/rui/toolkits/qt/qt.rb', line 108

def setGUI(gui)
  self.window_title = gui.opts[:caption]
  layout = Qt::VBoxLayout.new(self)
  widget = Qt::Widget.new(self)
  widget.owner = self
  widget.setGUI(gui)
  buttons = Qt::DialogButtonBox.new
  buttons.add_button(Qt::DialogButtonBox::Ok)
  buttons.add_button(Qt::DialogButtonBox::Cancel)
  layout.add_widget(widget)
  layout.add_widget(buttons)
  
  buttons.on(:accepted) { fire :ok_clicked; accept }
  buttons.on(:rejected) { reject }
end