freenode/#clim - IRC Chatlog
Search
7:47:42
jackdaniel
thrashdin: use function notify-user. as of frame name, you may use :name and :pretty-name initargs
15:24:50
scymtym
jackdaniel: i think i mentioned wanting to turn this into a separate thing: https://github.com/scymtym/trivial-with-current-source-form . would the README convey to you what the library does if you didn't already know?
15:51:33
scymtym
thrashdin: addresses and parts of addresses are displayed as "presentations". are you already familiar with those?
15:55:49
scymtym
presentations are for displaying something that has an associated object as well as a type. this allows applying commands to the displayed thing and using the displayed thing when an object of a certain type is required as a command argument
15:56:47
scymtym
presentation types are separate from ordinary CL types and classes, but classes can be used as presentation types
15:57:22
scymtym
however, you can present any object with any presentation type, regardless of its CL class or CL type
15:59:01
scymtym
for example, you can do (clim:define-presentation-type my-integer ()) and then (clim:with-output-as-presentation (stream "foo" 'my-integer) (write-string "foo" stream))
16:01:24
thrashdin
(define-presentation-method present (object (type creature) stream view &key) (declare (ignore view)) (write-string (format nil "~a, ~a" (name object) (%sym-to-str (race object))) stream))
16:03:22
scymtym
the displayed presentation will become clickable and selectable as soon as a command is applicable
16:04:05
scymtym
try (define-command (com-test :command-table YOUR-APPLICATION-NAME) ((creature creature :gesture :select))) [untested]
16:05:29
scymtym
where (define-command (… :command-table FOO) …) is the same as (define-FOO-command …) in case you are looking at the address book demo
16:11:24
scymtym
second question first: COM-TEST is a command. you (or in this case i) choose the names, parameters and behavior of commands for your application. try C-/ in an interactor pane to see all commands of an application. commands are invoked by 1) typing their names and arguments into an interactor 2) by clicking presentations
16:14:39
scymtym
if you want a persistent selection that the user can manipulate, you should make the selection information part of your application state and present creatures accordingly. for example, you could add a (%selected :type list :initform '() :accessor selector) slot to your application frame and add something like (if (member object (selected *application-frame*)) (with-drawing-options (stream :text-face :bold) (write-string …))