Class: Cosmos::LineGraphDialog

Inherits:
Qt::Dialog
  • Object
show all
Defined in:
lib/cosmos/gui/line_graph/line_graph_dialog.rb

Overview

Creates a dialog with a LineGraph in it

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, width = 400, height = 300) ⇒ LineGraphDialog

Returns a new instance of LineGraphDialog.

Parameters:

  • title (String)

    Dialog title

  • width (Integer) (defaults to: 400)

    Dialog width

  • height (Integer) (defaults to: 300)

    Dialog height



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/cosmos/gui/line_graph/line_graph_dialog.rb', line 24

def initialize(title, width = 400, height = 300)
  super(Qt::CoreApplication.instance.activeWindow)
  self.window_title = title
  @layout = Qt::VBoxLayout.new
  self.layout = @layout

  @line_graph = LineGraph.new(self)
  layout.addWidget(@line_graph)

  resize(width, height)
end

Instance Attribute Details

#line_graphLineGraph

Returns The dialog line graph.

Returns:



19
20
21
# File 'lib/cosmos/gui/line_graph/line_graph_dialog.rb', line 19

def line_graph
  @line_graph
end