Version 9 of Invoice Software

Updated 2011-02-14 12:08:02 by RLE

Hi Im Siqsuruq, im pretty new to this great community. One month ago ive started to develop little invoicing software using TCL/TK and PostgreSQL. I wondering if somebody is interested in helping me. Later on ill post a link to repository, for now you can contact me on admin(@)msysc(dot)org


Siqsuruq - 2011-01-06 17:50:18

Hi TCL community. Basically i don't need particular help with development. One friend of mine, told me once that programming has to be fun, so I just looking for people who is interested to work with me and have fun. Here you can find gziped code.

Daidze

Unpack it, create database (sql script inside db folder), change username and password inside ./incl/pgdb_class, run ./main.tcl. Give me opinion, critic, anything will be appreciated.

Thanks

P.S. Sorry my English, and Arjen sorry for email, I finally got basic idea of this wiki ;)

Or may be not :(


tclbliss - 2011-01-07

Well, I did not look at your software yet, but there is an obvious question - Why does a "little" invoice software need a "big" database server like PostgreSQL? Sqlite should be good enough.


Siqsuruq - 2011-01-09 15:56:32

Just today I was asked the same question. My choice of PostgreSQL is simple, ive never worked with SQLite, but got some experience with PostgreSQL. And I believe my software will grow later.


siqsuruq - 2011-02-13 21:14:24

Hi, I have one question. This code will rise error

can't read "a": no such variable
    while executing
"send_v $a"

My question, how can I send local variable from proc with button -command?

proc send_v {a} {
  puts $a
}

proc test {} {
  set a 1
  pack [ttk::checkbutton .b -variable tax::rep -onvalue 1] -side top -padx 2 -fill y
  pack [button .b2 -image [image create photo -file [file join img delete.png]] -relief flat -command {send_v $a}] -side left -padx 2 -pady 2
}

APN: replace -command {send_v $a} with -command [list send_v $a].

RLE (2011-02-14) The short answer is you can't. Once the proc exits, the local variable ceases to exist, so there is nothing more to send. Additionally, the -command binding executes in global scope, so it only sees global variables. APN's solution works if you are interested in maintaining what was the current 'value' of the local variable in the proc at the time the button -command was defined. But it does not access the variable at the time the button is pressed, which is what your question is implying you want to do. The command stored in the button simply becomes {send_v 1}.