Class: LogWindow
- Inherits:
-
Qt::Widget
- Object
- Qt::Widget
- LogWindow
- Defined in:
- lib/logwin.rb
Overview
Log Window
Instance Method Summary collapse
-
#initialize ⇒ LogWindow
constructor
A new instance of LogWindow.
- #write(text) ⇒ Object
Constructor Details
#initialize ⇒ LogWindow
Returns a new instance of LogWindow.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/logwin.rb', line 6 def initialize() super # create widgets @textWidget = KDE::TextEdit.new @textWidget.setReadOnly(true) clearBtn = KDE::PushButton.new( KDE::Icon.new('edit-clear'), i18n("C&lear") ) connect(clearBtn, SIGNAL(:clicked)) do @textWidget.clear end # layout layout = Qt::VBoxLayout.new layout.addWidget(@textWidget) layout.addWidgetAtLeft(clearBtn) setLayout(layout) end |
Instance Method Details
#write(text) ⇒ Object
25 26 27 28 |
# File 'lib/logwin.rb', line 25 def write(text) puts text @textWidget.append(text) end |