/[lgtk]/lgtk/examples/mp-hello-world.lisp
ViewVC logotype

Contents of /lgtk/examples/mp-hello-world.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Mon Oct 27 19:14:45 2003 UTC (10 years, 5 months ago) by mmommer
Branch: MAIN, mmommer
CVS Tags: initial_checkin, HEAD
Branch point for: test-branch, sbcl-port
Changes since 1.1: +0 -0 lines
Initial checkin.
1 ;; Hello World #1 from the GTK+ tutorial. This one runs in the
2 ;; background. My advice: don't do it.
3
4 (use-package :gtk)
5
6 (defun mp-hello-world ()
7 (let (idle-tag)
8 (labels ((hw (&rest args)
9 (format t "Hello world!~%"))
10
11 (delete-event (&rest args)
12 (format t "delete-event ocurred~%")
13 0)
14
15 (idle (data) (declare (ignore data))
16 (mp:process-yield)
17 t)
18
19 (destroy (&rest args)
20 (gtk-idle-remove idle-tag)
21 (format t "self-destruct.~%")
22 (gtk-main-quit)))
23
24 (let ((window (gtk-window-new :gtk-window-toplevel))
25 (button (gtk-button-new-with-label "Hello World!")))
26
27 (gtk-container-add window button)
28 (gtk-container-set-border-width window 10)
29
30 (gtk-widget-show button)
31 (gtk-widget-show window)
32
33 (g-signal-connect button gtkclicked #'hw)
34 (g-signal-connect window gtkdelete-event #'delete-event)
35 (g-signal-connect window gtkdestroy #'destroy)
36
37 (setf idle-tag (gtk-idle-add #'idle))
38
39 (mp:make-process #'gtk-main)))))

  ViewVC Help
Powered by ViewVC 1.1.5