Class: TKXXS_CLASSES::ChooseDirD

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) ⇒ ChooseDirD

See: TKXXS.choose_dir



1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
# File 'lib/tkxxs/tkxxs_classes.rb', line 1413

def initialize( initialdir=nil,help=nil,hash=nil )
  initialdir, help, hash = 
    TKXXS_CLASSES.args_1( initialdir,help,hash )
  hash = {
    :mode => :choosedir,
    :question=>"Please choose a directory",
    :title=>"Choose Directory",
  }.merge(hash)
  super(initialdir, help, hash)
end

Instance Method Details

#choose(hash) ⇒ Object



1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
# File 'lib/tkxxs/tkxxs_classes.rb', line 1424

def choose( hash )
  dirStr = Tk.chooseDirectory( hash )
  path =  dirStr.empty?  ?  nil  :  dirStr

  if path
    set_paths( path )
  else
    validate_and_leave
  end
  nil
end