Class: TKXXS_CLASSES::SaveFileD

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

See: TKXXS.save_file



1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
# File 'lib/tkxxs/tkxxs_classes.rb', line 1508

def initialize( initialdir=nil,help=nil,hash=nil )
  initialdir, help, hash = 
    TKXXS_CLASSES.args_1( initialdir,help,hash )
  hash = {
    :mode => :savefile,
    :question=>"Please choose, where to save the file:",
    :title=>"Save File As...",
    :filetypes => [['All files','*']],
    :initialfile => 'Untitled', # Default filename, extension will be added automatically by filetypes-setting
    :defaultextension => nil,
  }.merge(hash)
  super(initialdir, help, hash)
end

Instance Method Details

#choose(hash) ⇒ Object



1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
# File 'lib/tkxxs/tkxxs_classes.rb', line 1522

def choose( hash )
  fileStr = Tk.getSaveFile(hash)
  path =  fileStr.empty?  ?  nil  :  fileStr
  if path
    set_paths( path )
  else
    validate_and_leave
  end
  nil
end