/[lgtk]/lgtk/examples/tables-hw.lisp
ViewVC logotype

Contents of /lgtk/examples/tables-hw.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Mon Oct 27 19:14:47 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 ;; A hello world using tables
2 (use-package :gtk)
3
4 (defun tables-hw ()
5 (labels ((hw (wid data)
6 (format t "Hi. ~A was pressed.~%" data))
7
8 (destroy (&rest args)
9 (format t "self-destruct.~%")
10 (gtk-main-quit)))
11
12 (let ((window (gtk-window-new :gtk-window-toplevel))
13 (button1 (gtk-button-new-with-label "button 1"))
14 (button2 (gtk-button-new-with-label "button 2"))
15 (quitbut (gtk-button-new-with-label "Quit"))
16 (table (gtk-table-new 2 2 :homogeneous t)))
17
18 (gtk-window-set-title window "Table")
19 (gtk-container-set-border-width window 10)
20 (gtk-container-add window table)
21
22 (gtk-table-attach table button1 0 1 0 1)
23 (gtk-table-attach table button2 1 2 0 1)
24 (gtk-table-attach table quitbut 0 2 1 2)
25
26 (g-signal-connect button1 gtkclicked #'hw :data 1)
27 (g-signal-connect button2 gtkclicked #'hw :data 2)
28 (g-signal-connect window gtkdestroy #'destroy)
29 (g-signal-connect-swapped quitbut gtkclicked
30 #'gtk-widget-destroy
31 :data window)
32
33 (gtk-widget-show button1)
34 (gtk-widget-show button2)
35 (gtk-widget-show quitbut)
36 (gtk-widget-show table)
37 (gtk-widget-show window)
38
39 (gtk-main))))

  ViewVC Help
Powered by ViewVC 1.1.5