tk entry field?

Started by tom, July 15, 2006, 05:14:14 AM

Previous topic - Next topic

tom

howdy guys,



I have modified tcltk.lsp (distributed with newlisp) so

that I get this when I run it.



http://perpetualnewbie.info/pix/snapshot1.png">



Very impressive, isn't it?  Now, if only I could use

the string I type!  I have tried various ugly things,

with no luck.  Any suggestions?



Thanks.

Fanda

#1
I used newlisp-tk for running, but it shows the example:


;;
;; Tk entry widget test
;;

; window
(tk "toplevel .w")
(tk "wm title .w {Test}")

; entry
(tk "set ::entry_string {Type something here ;-)}")
(tk "entry .w.e -width 30 -textvariable ::entry_string")
(tk "pack .w.e")

; button
(tk "frame .w.buttons")
(tk "pack .w.buttons -side bottom -fill x -pady 2m")

(tk "button .w.buttons.show -text {Show text} -command {Newlisp {(show)}}")
(tk "pack .w.buttons.show -side left -expand 1")


; show Tk message box and print the string in newLISP
(define (show)
  (silent (tk {tk_messageBox -parent .w -title "Your text" -message "Text: $::entry_string" -type ok -icon info}))
  (println "Text: " (tk "set ::entry_string")))


Fanda