What is a lispier way of handling those 'messages', ideally, I think I
would like to create add more messages, that would be handled by a
function.
My question, from a library perspective, would it be easier to put them
the messages in a hash table where the values are functions?
And then the only argument to that function would be the hash table.
Table:
WM_CREATE - some_function
http://www.retroevolution.com/beta/widget_toolkit/orkit06.htm
Or maybe a list of lists, where the first element is a int and the next
is a function.
ramza2 wrote:
> What is a lispier way of handling those 'messages', ideally, I think I
> would like to create add more messages, that would be handled by a
> function.
>
> WM_CREATE - some_function
>
> http://www.retroevolution.com/beta/widget_toolkit/orkit06.htm
Check out Corman Common Lisp (www.cormanlisp.com). It comes complete
with source code and has a very nice method of doing this. I don't
exactly remember what the method is, just that I thought it was quite
elegant the last time I used CCL.
Barring that, since there aren't very many messages that you'll be
looking at, I'd just use a CASE statement:
(case message
(#.WM_CREATE (...))
(#.WM_PAINT (...))
(otherwise (DefWindowProc ...)))
Jeff M.
--
http://www.retrobyte.org
··············@gmail.com