Class: Zenity::List
Overview
Public: List dialog box wrapper.
Instance Attribute Summary collapse
-
#print_column ⇒ Object
writeonly
Sets the attribute print_column.
-
#separator ⇒ Object
writeonly
Sets the attribute separator.
Attributes inherited from Base
Instance Method Summary collapse
- #get_command ⇒ Object
-
#initialize(columns = ["Column Title"], data = ["Data"], options = []) ⇒ List
constructor
A new instance of List.
Methods inherited from Base
#cancel?, #error?, #expired?, #ok?, #proceed
Constructor Details
#initialize(columns = ["Column Title"], data = ["Data"], options = []) ⇒ List
Returns a new instance of List.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/zenity/list.rb', line 9 def initialize columns = ["Column Title"], data = ["Data"], = [] @command = "zenity --list \\\n" unless .empty? .each do |opt| if ['checklist', 'radiolist', 'editable'].include? opt @command += "--#{opt} \\\n" else raise "Unknown option #{opt} for zenity list" end end end columns.map! { |col| "--column=\"#{col}\"" } @command += columns.join(" ") + " \\\n" @command += data.join(" \\\n") end |
Instance Attribute Details
#print_column=(value) ⇒ Object (writeonly)
Sets the attribute print_column
7 8 9 |
# File 'lib/zenity/list.rb', line 7 def print_column=(value) @print_column = value end |
#separator=(value) ⇒ Object (writeonly)
Sets the attribute separator
7 8 9 |
# File 'lib/zenity/list.rb', line 7 def separator=(value) @separator = value end |
Instance Method Details
#get_command ⇒ Object
25 26 27 |
# File 'lib/zenity/list.rb', line 25 def get_command @command + option_separator + option_print_column + end |