Skip to content

Instantly share code, notes, and snippets.

@dmitryvk
Created November 16, 2010 05:39
Show Gist options
  • Save dmitryvk/701489 to your computer and use it in GitHub Desktop.
Save dmitryvk/701489 to your computer and use it in GitHub Desktop.
(defpackage #:q
(:use #:cl #:gtk)
(:export #:main))
(in-package #:q)
(defstruct line-width
title width)
(defun main ()
(within-main-loop
(let* ((Модель-типа (make-instance 'array-list-store))
(Список-типа-линий (make-instance 'combo-box :model Модель-типа))
(v-box (make-instance 'v-box))
(w (make-instance 'gtk-window :width-request 100 :height-request 100 :window-position :center)))
(store-add-column Модель-типа "gchararray" #'line-width-title)
(store-add-column Модель-типа "gchararray" #'line-width-width)
(let ((r (make-instance 'cell-renderer-text)))
(cell-layout-pack-end список-типа-линий r :expand t)
(cell-layout-add-attribute список-типа-линий r "text" 0))
(store-add-item модель-типа (make-line-width :title "Толщина 1" :width 1))
(store-add-item модель-типа (make-line-width :title "Толщина 2" :width 2))
(store-add-item модель-типа (make-line-width :title "Толщина 3" :width 3))
(store-add-item модель-типа (make-line-width :title "Толщина 4" :width 4))
(container-add w v-box)
(container-add v-box список-типа-линий)
(widget-show w))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment