Tk Source Code

Artifact [6f9974c4db]
Login

Artifact 6f9974c4db9e405f619a1ae7be439125cb5515671452f4aee65fd99325bad8c4:

Attachment "savePanelIssue.tcl" to ticket [837b5a3a6c] added by nab 2020-10-22 16:13:08.
package require Tk

ttk::button .b -text "push2Save"
bind .b <ButtonPress-1> {doSave}

grid .b -sticky news
grid columnconfigure . all -weight 1
grid rowconfigure . all -weight 1

proc doSave {} {
    set fixtype {{{test savePanel Files}       {.dld .xml}}}
    set thisFile [file rootname [\
        tk_getSaveFile -initialdir $::env(HOME) \
            -filetypes $fixtype \
            -initialfile testSavePanelFile \
            -defaultextension .dld\
        ]\
    ]
    puts "thisFile=$thisFile"
    set fo [open "$thisFile.dld" "w"]
    puts $fo $thisFile
    close $fo
}