/[gtk-cffi]/gtk-cffi/application.lisp
ViewVC logotype

Contents of /gtk-cffi/application.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Mon Apr 25 19:16:07 2011 UTC (2 years, 11 months ago) by rklochkov
Branch: slavsoft, MAIN
CVS Tags: initial, HEAD
Changes since 1.1: +0 -0 lines

Initial release
1 (defpackage #:gtk-application
2 (:use #:common-lisp #:gtk-cffi)
3 (:export #:run))
4
5 (in-package #:gtk-application)
6
7 (gtk-init)
8
9 (defclass application (window)
10 ((menu :accessor menu :initform (make-instance 'menu-bar))
11 (toolbar :accessor toolbar :initform (make-instance 'toolbar))
12 (notebook :accessor notebook :initform (make-instance 'notebook))
13 (statusbar :accessor statusbar :initform (make-instance 'statusbar))
14 (textview :accessor textview :initform (make-instance 'text-view))))
15
16
17 (defmethod initialize-instance :after ((application application)
18 &key &allow-other-keys)
19 (let ((v-box (make-instance 'v-box)))
20 (add application v-box)
21 (with-slots (menu toolbar notebook statusbar textview) application
22 (pack* v-box
23 :expand nil
24 menu toolbar
25 :expand t
26 notebook textview
27 :expand nil
28 statusbar)))
29 (setf (gsignal application :destroy) :gtk-main-quit))
30
31 (let ((win (make-instance 'application :width 400)))
32
33 (show win)
34
35 (gtk-main))

  ViewVC Help
Powered by ViewVC 1.1.5