2

What I am trying to do: I have a preexisting game that uses LTK for its user interface. The game contains numerous buttons, canvases, and windows. I would like to access the GUI from a remote computer through ltk-remote, as described in section 7 of the linked manual.

What I did: I quickloaded ltk-remote, ran (with-remote-ltk 9898 form), the form being a function launching the game, then ran wish remote.tcl localhost 9898 in a terminal. (The port number 9898 is arbitrary.) This led to the problem detailed by user @Sim in this question, which I resolved using their answer. This may have caused problems (as Sim suggests).

The problem: The GUI starts running, but only reacts partially to some events. The easiest isolated effect is that when an event prompts a new window opening, it does not open. If there are more windows to be opened, all except for the first one will open. This is a minimal example:

(ltk:with-remote-ltk 9898 nil
    (let ((b (make-instance 'ltk:button)))
      (setf (ltk:command b) #'(lambda ()
                                (make-instance 'ltk:toplevel :title "title 1")
                                (make-instance 'ltk:toplevel :title "title 2")
                                (make-instance 'ltk:toplevel :title "title 3")))
      (ltk:grid b 0 0)))

Clicking the button only opens "title 2" and "title 3".

I haven't seen any evidence of anybody using ltk-remote successfully, and thus the library itself could be bugged. Could anybody share their experiences?

Kotlopou
  • 415
  • 3
  • 13
  • 1
    If I use the modified `remote-client.tcl` in my answer at https://stackoverflow.com/a/68035159/124319, then whenever I click on the button, the three toplevel windows appear (sbcl, linux) – coredump Jun 18 '21 at 12:36
  • If I run `remote-client.tcl` (modified or not) instead of `remote.tcl`, events do not affect the GUI at all. Instead, they are merely printed in the terminal I run it from. If I modify `remote-client.tcl`, then run `remote.tcl`, the bug in question persists. – Kotlopou Jun 18 '21 at 14:28
  • 1
    The mistake was on my side - I left in the line from the other answer in the linked question. I'm not sure what to do with this question now, as all relevant information is in the other question. – Kotlopou Jun 21 '21 at 19:40
  • 1
    Cool, it's nice if that works. It's perfectly fine if you write a short answer that summarize what works (you can link to the other answer for example) and accept it – coredump Jun 21 '21 at 20:01

0 Answers0