Class: Golumn::App

Inherits:
WX::App
  • Object
show all
Defined in:
lib/golumn/app.rb

Overview

Main app window

Instance Method Summary collapse

Constructor Details

#initialize(io: ARGF) ⇒ App

Returns a new instance of App.



6
7
8
# File 'lib/golumn/app.rb', line 6

def initialize(io: ARGF)
  @io = io
end

Instance Method Details

#on_initObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/golumn/app.rb', line 10

def on_init
  @frame = WX::Frame.new(nil, title: 'widgets demo')
  @frame.sizer = WX::BoxSizer.new(:vertical) do |box|
    @grid = WX::Grid.new(@frame)
    @grid.table = ArrayGrid.new(data: CSV.parse(@io.read))
    box.add(@grid, expand: true)
  end
  @frame.layout
  @frame.show
end