Sha256: b4dfd97b340af3a9969b13a5a1ccd8ef1527fa9098dd9c4fa2986dbe03250a20

Contents?: true

Size: 1.85 KB

Versions: 3

Compression:

Stored size: 1.85 KB

Contents

# ----------------------------------------------------------------------------- #
#         File: testflowlayout.rb
#  Description:
#       Author: j kepler  http://github.com/mare-imbrium/canis/
#         Date: 2014-05-09 - 20:24
#      License: MIT
#  Last update: 2014-05-09 20:39
# ----------------------------------------------------------------------------- #
#  testflowlayout.rb  Copyright (C) 2012-2014 j kepler

if __FILE__ == $PROGRAM_NAME
  require 'canis/core/util/app'
  require 'canis/core/widgets/listbox'
  require 'canis/core/include/layouts/flowlayout'
  App.new do

    # if i add form here, it will repaint them first, and have no dimensions
    lb = Listbox.new @form, :list => ["borodin","berlioz","bernstein","balakirev", "elgar"] , :name => "mylist"
    lb1 = Listbox.new @form, :list => ["bach","beethoven","mozart","gorecki", "chopin","wagner","grieg","holst"] , :name => "mylist1"

    lb2 = Listbox.new @form, :list => `gem list --local`.split("\n") , :name => "mylist2"
=begin

    alist = %w[ ruby perl python java jruby macruby rubinius rails rack sinatra pylons django cakephp grails]
    str = "Hello, people of Earth.\nI am HAL, a textbox.\nUse arrow keys, j/k/h/l/gg/G/C-a/C-e/C-n/C-p\n"
    str << alist.join("\n")
    tv = TextPad.new @form, :name => "text", :text => str.split("\n")
=end

    w = Ncurses.COLS-1
    h = Ncurses.LINES-3
    #layout = StackLayout.new :height => -1, :top_margin => 1, :bottom_margin => 1, :left_margin => 1
    layout = FlowLayout.new :height => -1, :top_margin => 1, :bottom_margin => 1, :left_margin => 1
    layout.form = @form
    @form.layout_manager = layout
    layout.cset lb, :weight, 15
    layout.cset lb1, :weight, 25
    #$status_message.value =" Flow: #{@r.components[0].orientation} | Stack #{@r.components[1].orientation}. Use Ctrl-Space to change "


    st = status_line :row => -1
  end # app
end # if

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
canis-0.0.13 examples/testflowlayout.rb
canis-0.0.11 examples/testflowlayout.rb
canis-0.0.10 examples/testflowlayout.rb