I have been trying to learn McCLIM and it has been quite difficult given the terseness of the documentation. After reading the manual I haven't been able to figure out how to associate a click to a pane and run a command. I am aware I can define commands such as:
(define-app-command (com-say :name t) ()
(format t "Hello world!"))
And type Say
into the command box to get it to do something. I would like to click a pane and have it output this hello world string when clicked.
What do I need to set up in order to enable click listeners on a given pane?
There are at least two ways you can do that. The first would be using
presentations
andpresentation-to-command-translator
and second would use gadgets (aka. widgets) likepush-button
. I guess you haven't learned aboutpresentations
yet, so I would show you how to do it with gadgets.The below example would have a pane and a push button. when you click the button, you would see "Hello World!" output to the pane.
P.S. One way to learn how to do something in McCLIM is to run and look at
clim-demos
. Once you find something interesting and want to know how it is done, look at its source inExamples
directory of McCLIM source.For Help, it is much better to use IRC chat (#clim on libera.chat) where multiple McCLIM devs hang out.
EDIT: Second example with
presentation-to-command-translator
, clicking anywhere in the pane would output "Hello World!" in the pane.