ltk-user Digest, Vol 20, Issue 1

vindarel vindarel at mailz.org
Wed Oct 28 13:51:28 UTC 2020


Hello,

I don't have a problem running this function. We didn't see all your
code, what did you type before and how did you call the function?

I don't have a problem when I am in the ltk-user package:

(in-package :ltk-user)

(defun hello()
  (with-ltk ()
    (let* ((tx (make-instance 'text )))
      (pack tx))))

(hello)
=> opens a text widget

However, to stay in the cl-user package, I prefixed the ltk functions:

(defun hello()
  (ltk:with-ltk ()
    (let* ((tx (make-instance 'ltk:text )))
      (ltk:pack tx))))

(hello)
=> ok

So you probably want to "use" ltk, with (use-package :ltk) or in your
package definition.

Looking at the first steps tutorial
(http://www.peter-herth.de/ltk/ltkdoc/node5.html), there is no mentions
of packages, but here there is: https://lispcookbook.github.io/cl-cookbook/gui.html#tk

Best,
Vincent



On 28/10/2020 13:00, ltk-user-request at common-lisp.net wrote:
> Send ltk-user mailing list submissions to
> 	ltk-user at common-lisp.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://mailman.common-lisp.net/listinfo/ltk-user
> or, via email, send a message with subject or body 'help' to
> 	ltk-user-request at common-lisp.net
>
> You can reach the person managing the list at
> 	ltk-user-owner at common-lisp.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ltk-user digest..."
>
>
> Today's Topics:
>
>    1. error on first steps with LTK (Ulrich Vollert)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 26 Oct 2020 19:11:02 +0100
> From: Ulrich Vollert <ulrivo at gmx.de>
> To: ltk-user at common-lisp.net
> Subject: error on first steps with LTK
> Message-ID: <1722B608-9760-415B-B1D5-87B9B0F14A4C at gmx.de>
> Content-Type: text/plain;	charset=us-ascii
>
> Hello,
>
> I am trying to make a text widget:
>
> (defun hello()
>   (with-ltk ()
>     (let* ((tx (make-instance 'text )))
>       (pack tx))))
>
>
> But I get an error (here the messages by slime):
>
> too many colons in "07"
>
>   Stream: #<TWO-WAY-STREAM
>             :INPUT-STREAM #<SB-SYS:FD-STREAM for "descriptor 16" {1005CE4193}>
>             :OUTPUT-STREAM #<SB-SYS:FD-STREAM for "descriptor 9" {1005CE45B3}>>
>    [Condition of type SB-INT:SIMPLE-READER-ERROR]
>
> Restarts:
>  0: [SEND-TO-DEBUGGER] Send condition to the debugger
>  1: [ABORT] Abort handling Tk event
>  2: [EXIT] Exit Ltk main loop
>  3: [RETRY] Retry SLIME REPL evaluation request.
>  4: [*ABORT] Return to SLIME's top level.
>  5: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {10026087A3}>)
>
> Backtrace:
>   0: (SB-IMPL::READ-TOKEN #<TWO-WAY-STREAM :INPUT-STREAM #<SB-SYS:FD-STREAM for "descriptor 16" {1005CE4193}> :OUTPUT-STREAM #<SB-SYS:FD-STREAM for "descriptor 9" {1005CE45B3}>> #\1)
>   1: (SB-IMPL::READ-MAYBE-NOTHING #<TWO-WAY-STREAM :INPUT-STREAM #<SB-SYS:FD-STREAM for "descriptor 16" {1005CE4193}> :OUTPUT-STREAM #<SB-SYS:FD-STREAM for "descriptor 9" {1005CE45B3}>> #\1)
>   2: (SB-IMPL::%READ-PRESERVING-WHITESPACE #<TWO-WAY-STREAM :INPUT-STREAM #<SB-SYS:FD-STREAM for "descriptor 16" {1005CE4193}> :OUTPUT-STREAM #<SB-SYS:FD-STREAM for "descriptor 9" {1005CE45B3}>> NIL NIL T)
>   3: (SB-IMPL::%READ-PRESERVING-WHITESPACE #<TWO-WAY-STREAM :INPUT-STREAM #<SB-SYS:FD-STREAM for "descriptor 16" {1005CE4193}> :OUTPUT-STREAM #<SB-SYS:FD-STREAM for "descriptor 9" {1005CE45B3}>> NIL NIL NI..
>   4: (READ-EVENT :BLOCKING T :NO-EVENT-VALUE (NIL))
>   5: ((LABELS LTK::PROC-EVENT :IN LTK::MAIN-ITERATION))
>   6: (MAINLOOP :SERVE-EVENT NIL)
>   7: ((LAMBDA (CONDITION) :IN LTK::MAKE-CONDITION-HANDLER-FUNCTION) #<SIMPLE-ERROR "When reading from tcl, expected a list but instead got ~S" {1005CFB063}>)
>   8: (SB-KERNEL::%SIGNAL #<SIMPLE-ERROR "When reading from tcl, expected a list but instead got ~S" {1005CFB063}>)
>   9: (ERROR "When reading from tcl, expected a list but instead got ~S" |2020-10-26|)
>  10: (LTK::VERIFY-EVENT |2020-10-26|)
>  11: ((LABELS LTK::PROC-EVENT :IN LTK::MAIN-ITERATION))
>  12: (LTK::MAIN-ITERATION :BLOCKING T :REENTRANT? NIL)
>  13: ((LAMBDA (LTK::THUNK) :IN LTK::MAKE-CALL-WITH-CONDITION-HANDLERS-FUNCTION) #<FUNCTION (LAMBDA NIL :IN MAINLOOP) {2279624B}>)
>  14: (MAINLOOP :SERVE-EVENT NIL)
>  15: (CALL-WITH-LTK #<FUNCTION (LAMBDA NIL :IN HELLO) {227BF74B}>)
>  16: (SB-INT:SIMPLE-EVAL-IN-LEXENV (HELLO) #<NULL-LEXENV>)
>  17: (EVAL (HELLO))
>  18: (SWANK::EVAL-REGION "(hello) ..)
>  19: ((LAMBDA NIL :IN SWANK-REPL::REPL-EVAL))
>  20: (SWANK-REPL::TRACK-PACKAGE #<CLOSURE (LAMBDA NIL :IN SWANK-REPL::REPL-EVAL) {1005CE26FB}>)
>  21: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME REPL evaluation request." #<CLOSURE (LAMBDA NIL :IN SWANK-REPL::REPL-EVAL) {1005CE269B}>)
>  22: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CLOSURE (LAMBDA NIL :IN SWANK-REPL::REPL-EVAL) {1005CE267B}>)
>  23: (SWANK-REPL::REPL-EVAL "(hello) ..)
>  24: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK-REPL:LISTENER-EVAL "(hello) ..)
>  25: (EVAL (SWANK-REPL:LISTENER-EVAL "(hello) ..)
>  26: (SWANK:EVAL-FOR-EMACS (SWANK-REPL:LISTENER-EVAL "(hello) ..)
>  27: (SWANK::PROCESS-REQUESTS NIL)
>  28: ((LAMBDA NIL :IN SWANK::HANDLE-REQUESTS))
>  29: ((LAMBDA NIL :IN SWANK::HANDLE-REQUESTS))
>  30: (SWANK/SBCL::CALL-WITH-BREAK-HOOK #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA NIL :IN SWANK::HANDLE-REQUESTS) {10026180FB}>)
>  31: ((FLET SWANK/BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/Users/ulrivo/Dropbox/emacs/.emacs.d/elpa/slime-20200810.224/swank/sbcl.lisp") #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA NIL :IN SWANK::..
>  32: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-INPUT* . #<SWANK/GRAY::SLIME-INPUT-STREAM {10025F0BF3}>)) #<CLOSURE (LAMBDA NIL :IN SWANK::HANDLE-REQUESTS) {100261811B}>)
>  33: (SWANK::HANDLE-REQUESTS #<SWANK::MULTITHREADED-CONNECTION {10022D30F3}> NIL)
>  34: ((FLET SB-UNIX::BODY :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
>  35: ((FLET "WITHOUT-INTERRUPTS-BODY-4" :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
>  36: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
>  37: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-THREAD::CALL-WITH-MUTEX))
>  38: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE) {115E7E7B}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THREAD "repl-th..
>  39: (SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE #<SB-THREAD:THREAD "repl-thread" RUNNING {10026087A3}> NIL #<CLOSURE (LAMBDA NIL :IN SWANK-REPL::SPAWN-REPL-THREAD) {100260874B}> NIL)
>  40: ("foreign function: call_into_lisp")
>  41: ("foreign function: new_thread_trampoline")
>
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> ltk-user mailing list
> ltk-user at common-lisp.net
> https://mailman.common-lisp.net/listinfo/ltk-user
>
>
> ------------------------------
>
> End of ltk-user Digest, Vol 20, Issue 1
> ***************************************




More information about the ltk-user mailing list