Class: TKXXS_CLASSES::OpenFileD

Inherits:
FileAndDirChooser show all
Defined in:
lib/tkxxs/tkxxs_classes.rb

Constant Summary

Constants inherited from FileAndDirChooser

FileAndDirChooser::CONF

Instance Attribute Summary

Attributes inherited from FileAndDirChooser

#dialog

Instance Method Summary collapse

Methods inherited from FileAndDirChooser

#add2favorites_dirs_chk, #add2favorites_files_chk, #answer, #browse_btn, #cancel_btn, #entry, #fav_dirs, #fav_dirs_chk_changed, #fav_files, #fav_files_chk_changed, #favorite_chk_label, #favorite_dirs_btn, #favorite_files_btn, #favorite_lbl, #favorites_and_recent, #ok_btn, #paste_btn, #paste_lbl, #question_lbl, #recent_dirs, #recent_dirs_btn, #recent_files, #recent_files_btn, #recent_lbl, #set_paths, #text2, #tks_result_to_ary, #use_entry, #validate_and_leave, #validate_and_set_path

Constructor Details

#initialize(initialdir = nil, help = nil, hash = nil) ⇒ OpenFileD

See: TKXXS.open_file



1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
# File 'lib/tkxxs/tkxxs_classes.rb', line 1476

def initialize( initialdir=nil,help=nil,hash=nil )
  initialdir, help, hash = 
    TKXXS_CLASSES.args_1( initialdir,help,hash )
  hash = {
    :mode => :openfile,
    :question=>"Please choose the desired file",
    :title=>"Open File",
    :filetypes => [['All files','*']],
    :multiple=>false 
  }.merge(hash)
  super(initialdir, help, hash)
end

Instance Method Details

#choose(hash) ⇒ Object



1489
1490
1491
1492
1493
1494
1495
1496
1497
# File 'lib/tkxxs/tkxxs_classes.rb', line 1489

def choose( hash )
  fileStr = Tk.getOpenFile(hash)
  if fileStr
    set_paths( fileStr )
  else
    validate_and_leave
  end
  nil
end