/[gtk-cffi]/gtk-cffi/examples/ex1-new.lisp
ViewVC logotype

Contents of /gtk-cffi/examples/ex1-new.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Fri Aug 26 17:16:13 2011 UTC (2 years, 7 months ago) by rklochkov
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +7 -2 lines
Added GTK3 support. Dropped GTK2 support.
Refactored CFFI layer.
1 (asdf:oos 'asdf:load-op :gtk-cffi)
2
3 (defpackage #:test-ex1n
4 (:use #:common-lisp #:gtk-cffi #:g-object-cffi))
5 (in-package #:test-ex1n)
6
7 (gtk-init)
8 (defparameter *window*
9 (gtk-model
10 'window :width 80
11 :title "Hello world!"
12 :signals `(:destroy
13 :gtk-main-quit
14 :enter-notify-event
15 ,(lambda (widget event)
16 (declare (ignore widget event))
17 (format t "Entered~%")))
18 ('button :label "Hello!"
19 :signals (list :clicked
20 (let ((count 0))
21 (lambda (widget)
22 (declare (ignore widget))
23 (format t "Pressed ~a times~%"
24 (incf count))))))))
25 (show *window*)
26 (gtk-main)
27

  ViewVC Help
Powered by ViewVC 1.1.5