Thursday the inaugural meeting of the new San Diego Tcl/Tk UG took place.
6 Kplugers of varrying Tcl experience and Darren. Darren presented on a S3
manipulation library he's put together.

Please note that as an executive action, Darren shortened our acronym to
SDTUG. I like it better.

The gathering was enthusiastic enough to commit to a meeting next month.
I'm going to try to arrange a remote presentation on WyattERP, an open
sourced system for rapid application development of ERP systems for small
to medium enterprises using Tcl/Tk and PostgreSQL.

http://www.wyatterp.com/index.html

Until we get more momentum, we'll have no web site and will use the LPSG
mailing list for our communication (thanks KPLUG and LPSG).

For giggles, I'll stream in a small Tk program that you all can cut out,
make executible, and play with. Not my own -- written by a guy named Clif
Flynt. Fun, though.

***********************

#!/usr/bin/wish

# from Clif Flynt's tutorial, Tcl Conf '05

# create the first 9 number buttons
for {set i 1} {$i <= 9} {set i [expr $i+1]} {
        button .b$i -text "$i" -command "append cmd $i"
        set row [expr ($i-1) / 3]
        set col [expr ($i-1) % 3]
        grid .b$i -row $row -column $col
}

# now create the two rows of operaters and the 10th number button

# start with a list of buttons and commands
set col 0
incr row
set buttonList {+       {append cmd " + "}
                0       {append cmd 0}
                -       {append cmd " - "}
                *       {append cmd " * "}
                /       {append cmd " / "}
                =       {set result [expr $cmd]; set cmd "" }
                }

# then put the last 2 rows of buttons up
foreach {label buttonCmd} $buttonList {
        button .button_$label -text $label -command $buttonCmd
        grid .button_$label -row $row -column $col
        incr col
        if {[expr $col % 3] == 0} {
                incr row
                set col 0
        }
}

# a label widget to show the command as entered
label .cmd -textvariable cmd
grid .cmd -row 7 -column 0 -columnspan 3

# another label widget to show the result
label .value -textvariable result
grid .value -row 8 -column 0 -columnspan 3

# That's all there is -- 29 LOC minus comments and space


***********************

-- 
Lan Barnes

SCM Analyst              Linux Guy
Tcl/Tk Enthusiast        Biodiesel Brewer


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to