Class: Cosmos::ScrollTextDialog

Inherits:
Qt::Dialog show all
Defined in:
lib/cosmos/gui/dialogs/scroll_text_dialog.rb

Instance Method Summary collapse

Methods inherited from Qt::Dialog

#exec

Constructor Details

#initialize(parent, title, text) ⇒ ScrollTextDialog

Returns a new instance of ScrollTextDialog.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/cosmos/gui/dialogs/scroll_text_dialog.rb', line 16

def initialize(parent, title, text)
  super(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
  setMinimumWidth(700)
  setMinimumHeight(400)

  setWindowTitle(title)
  # Intentionally don't load icon as this can cause loop of unexpected output running with --debug

  layout = Qt::VBoxLayout.new
  text.gsub!("\n","<br>")
  @text_edit = Qt::TextEdit.new(text, self)
  @text_edit.setReadOnly(true)
  layout.addWidget(@text_edit)

  self.setLayout(layout)
  self.raise
  self.exec
  self.dispose
end