1 # Copyright (c) 2009 Paolo Capriotti <p.capriotti@gmail.com>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
10 class Console < Qt::Widget
13 def initialize(parent)
16 layout = Qt::VBoxLayout.new
17 @output = Qt::TextEdit.new(self)
18 @input = Qt::LineEdit.new(self)
20 layout.add_widget(@output)
21 layout.add_widget(@input)
24 @output.read_only = true
26 f.family = 'monospace'
29 @output.current_font = f
31 @bold_font.bold = true
33 @input.on(:returnPressed) do
35 with_font(@bold_font) do
44 old = @output.current_font
45 @output.current_font = font
47 @output.current_font = old