tk entry field?

Q&A's, tips, howto's
Locked
tom
Posts: 168
Joined: Wed Jul 14, 2004 10:32 pm

tk entry field?

Post by tom »

howdy guys,

I have modified tcltk.lsp (distributed with newlisp) so
that I get this when I run it.

Image

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
Posts: 253
Joined: Tue Aug 02, 2005 6:40 am
Contact:

Post by Fanda »

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

Code: Select all

;;
;; 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

Locked