Hi,
I'm starting to use LTK but there's one feature I need and have been unable to find. Essentially I want to be able to retrieve the selected text in a text widget. I searched through the docs and source but couldn't find anything (I apologize if I've missed it).
I'm very new to Lisp (and Tk!) but I managed to write this:
(defmethod selected ((text text)) (format-wish "senddatastring [~a get sel.first sel.last]" (widget-path text)) (read-data))
...which works but causes problems if no text is selected.
Is there an obvious way around this (or, even better, an existing function to do the job that I've just missed)?
Many thanks in advance for any help you can offer (and thanks to Peter for writing the library!).
Phil
Hello:
I believe you should use:
(text text-widget)
2006/11/15, Phil Armitage philip.armitage@gmail.com:
Hi,
I'm starting to use LTK but there's one feature I need and have been unable to find. Essentially I want to be able to retrieve the selected text in a text widget. I searched through the docs and source but couldn't find anything (I apologize if I've missed it).
I'm very new to Lisp (and Tk!) but I managed to write this:
(defmethod selected ((text text)) (format-wish "senddatastring [~a get sel.first sel.last]" (widget-path text)) (read-data))
...which works but causes problems if no text is selected.
Is there an obvious way around this (or, even better, an existing function to do the job that I've just missed)?
Many thanks in advance for any help you can offer (and thanks to Peter for writing the library!).
Phil _______________________________________________ ltk-user site list ltk-user@common-lisp.net http://common-lisp.net/mailman/listinfo/ltk-user
I believe you should use:
(text text-widget)
Hi,
Thanks for taking the time to reply.
I've not got access to my lisp environment at the moment so I can't confirm but I thought that would just retrieve the full text contents of the widget and not the selected text. But maybe I'm mistaken.
Many thanks. Phil