diff options
author | mifpasoti <46360451+mifpasoti@users.noreply.github.com> | 2019-01-03 18:41:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-03 18:41:13 -0500 |
commit | ea787200c2c3a4af54594dae98998c7a18949993 (patch) | |
tree | 0389cbd43805a77b9bd211d4ebe6819ae987997a /demo2 | |
parent | 14b0b6f70e16064a03330716320b89f817557325 (diff) | |
download | gtk-demos-ea787200c2c3a4af54594dae98998c7a18949993.tar.gz gtk-demos-ea787200c2c3a4af54594dae98998c7a18949993.tar.bz2 gtk-demos-ea787200c2c3a4af54594dae98998c7a18949993.zip |
Add files via upload
Diffstat (limited to 'demo2')
-rw-r--r-- | demo2 | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -0,0 +1,41 @@ +#!/bin/bash +sbcl --script << 'EOF' 2> >(sed '/^Backtrace/,$d;/^; /d') + +; Refer to the demostuff file for definitions and descriptions. + +(load "demostuff") + +(defun main () + (gapp demo2 + (window win demo2 "Numerals Demo" 250 250) + (box h outerbox win) + (box v mainbox outerbox) + (box h numbox mainbox) + (button but1 (bnt 1) mainbox (xnum (bn 1))) + (button but2 (bnt 2) mainbox (xnum (bn 2))) + (button but3 (bnt 3) mainbox (xnum (bn 3))) + (button but4 (bnt 4) mainbox (xnum (bn 4))) + (button but5 (bnt 5) mainbox (xnum (bn 5))) + (button numeralbutton "Numerals" mainbox (togglenumar)) + (text thenum "zero" numbox) + (gtk_widget_show_all win)) + (g_application_run demo2 0 nil) + (g_object_unref demo2)) + +(defparameter numar 'a) ; 'r = I II II IV V. 'a = 1 2 3 4 5. + +; Button number (bn) and button number text (bnt): +(defun bn (n) (nth (1- n) '(11 22 33 44 55))) +(defun bnt (n) (format nil (if (eq numar 'a) "~d" "~@R") (bn n))) + +(defun togglenumar () + (setq numar (if (eq numar 'a) 'r 'a)) + (loop as button in (list but1 but2 but3 but4 but5) + as n from 1 to 5 + do (xlabel button (bnt n)))) + +(defun xnum (n) (xtext thenum (format nil "~R" n))) + +(main) + +EOF |