summaryrefslogtreecommitdiffstats
path: root/demo3.tl
diff options
context:
space:
mode:
Diffstat (limited to 'demo3.tl')
-rwxr-xr-xdemo3.tl18
1 files changed, 18 insertions, 0 deletions
diff --git a/demo3.tl b/demo3.tl
new file mode 100755
index 0000000..d2ec257
--- /dev/null
+++ b/demo3.tl
@@ -0,0 +1,18 @@
+; Refer to the demostuff file for definitions and descriptions.
+
+(defun demo3 ()
+ (window demo3 demos "Dates Demo" 300 200)
+ (box h outerbox3 demo3)
+ (box v mainbox3 outerbox3)
+ (button date1 "1066" mainbox3 (relabel date1 1066))
+ (button date2 "1415" mainbox3 (relabel date2 1415))
+ (button date3 "1492" mainbox3 (relabel date3 1492))
+ (button date4 "1620" mainbox3 (relabel date4 1620))
+ (button date5 "1776" mainbox3 (relabel date5 1776))
+ (gtk_widget_show_all demo3))
+
+(defun relabel (button number)
+ (let* ((old (gtk_button_get_label button))
+ (isdigits (<= 0 (- (chr-int [old 0]) (chr-int #\0)) 9))
+ (new (format nil (if isdigits "~@R" "~d") number)))
+ (xlabel button new)))