aboutsummaryrefslogtreecommitdiff
path: root/colorgrid/base64.tcl
diff options
context:
space:
mode:
authorlluís gómez i bigordà <lluisbigorda@users.sourceforge.net>2007-10-24 20:37:21 +0000
committerlluís gómez i bigordà <lluisbigorda@users.sourceforge.net>2007-10-24 20:37:21 +0000
commit3c050000c6918b77a353583999e6e810aa675fda (patch)
treefc6aab7c92efb156966f5c926517f2f02e7b417e /colorgrid/base64.tcl
This commit was generated by cvs2svn to compensate for changes in r8875,svn2git-root
which included commits to RCS files with non-trunk default branches. svn path=/trunk/externals/pdvjtools/; revision=8876
Diffstat (limited to 'colorgrid/base64.tcl')
-rw-r--r--colorgrid/base64.tcl29
1 files changed, 29 insertions, 0 deletions
diff --git a/colorgrid/base64.tcl b/colorgrid/base64.tcl
new file mode 100644
index 0000000..26ad408
--- /dev/null
+++ b/colorgrid/base64.tcl
@@ -0,0 +1,29 @@
+ package require base64
+
+ proc encode {} {
+ .txt delete 1.0 end
+ set fileID [open [tk_getOpenFile] RDONLY]
+ fconfigure $fileID -translation binary
+ set rawData [read $fileID]
+ close $fileID
+ set encodedData [base64::encode $rawData]
+ .txt insert 1.0 $encodedData
+ }
+
+ proc clipcopy {} {
+ clipboard clear
+ clipboard append [.txt get 1.0 end]
+ }
+
+ wm title . "Base64 Gif Encoder"
+ text .txt -wrap none -font "Courier 10"
+ menu .mbar
+ . configure -menu .mbar
+ .mbar add command -label "Encode File" -command encode
+ .mbar add command -label "Copy2Clipboard" -command clipcopy
+ .mbar add command -label "Exit" -command {destroy .; exit}
+
+ pack .txt -expand 1 -fill both
+
+ encode
+ ### End of Script