mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-29 06:15:23 -04:00
TCL Backend 2.5.0
This commit is contained in:
parent
6ad8db3c77
commit
fe83bb1f36
5 changed files with 1050 additions and 0 deletions
20
backend_tcl/demo/demo.tcl
Normal file
20
backend_tcl/demo/demo.tcl
Normal file
|
@ -0,0 +1,20 @@
|
|||
package require Tk
|
||||
lappend auto_path [file dirname [info script]]/../lib
|
||||
package require zint
|
||||
image create photo ::zintimg
|
||||
pack [label .l -image ::zintimg] -side left
|
||||
pack [ttk::separator .s -orient vertical] -side left
|
||||
pack [::ttk::combobox .c -values [lsort [zint symbologies]] -state readonly]\
|
||||
-side top -fill x
|
||||
.c set Datamatrix
|
||||
pack [::ttk::entry .e] -side top -fill x
|
||||
.e insert end 12345
|
||||
bind .e <Return> Generate
|
||||
pack [::ttk::button .b -text Generate -command Generate] -fill x -side top
|
||||
proc Generate {} {
|
||||
::zintimg blank
|
||||
if {[catch {zint encode [.e get] ::zintimg -barcode [.c get]} e]} {
|
||||
tk_messageBox -message $e -title "Zint error"
|
||||
}
|
||||
}
|
||||
Generate
|
Loading…
Add table
Add a link
Reference in a new issue