Tk Source Code

Artifact [7487adcd]
Login

Artifact 7487adcd0324607cb6e7897467bad5a502911ab7f5800dc6002425ea4259bb2d:

Attachment "popUpMenuIssue.tcl" to ticket [fc5073a4] added by nab 2022-02-04 12:39:01.
package require Tk
package require baltip
::baltip config -global yes -per10 1000 -bg lightyellow -fg black -font fixed

set f [ttk::frame .f]
ttk::button $f.but -text "Browse ..." -command {fileDialog $f}
::baltip tip $f.but "Import file"

bind $f.but <ButtonPress-1> {
    fileDialog %W
}
proc fileDialog {w} {
    set types {{"All files"        *}}
    tk_getOpenFile -filetypes $types -parent $w
}

grid .f.but -sticky news
grid .f -sticky news
grid rowconfigure .f all -weight 1
grid columnconfigure .f all -weight 1