guile-pstk

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 2b87f3b7c7c6c7d6b33263519a02ec2aa8ec9fb4
parent 5af0df056c5e9133882f4d5ef8ca138535c031e5
Author: KikyTokamuro <kiky.tokamuro@yandex.ru>
Date:   Fri, 18 Mar 2022 20:47:19 +0300

Added new example 'slider'

Diffstat:
MREADME.md | 1+
Aexamples/slider.scm | 31+++++++++++++++++++++++++++++++
Aimages/slider.png | 0
3 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -17,6 +17,7 @@ PS/TK version (http://mirror.informatimago.com/scheme/www.t3x.org/pstk/index.htm | [ttt.scm](./examples/ttt.scm) | ![ttt](./images/ttt.png) | | [weather](./examples/weather.scm) | ![weather](./images/weather.png) | | [canvas](./examples/canvas.scm) | ![canvas](./images/canvas.png) | +| [slider](./examples/slider.scm) | ![slider](./images/slider.png) | ### Tested on ``` diff --git a/examples/slider.scm b/examples/slider.scm @@ -0,0 +1,31 @@ +; PS/Tk Example Program "Slider" +; Copyright (C) 2022 Daniil Archangelsky aka Kiky Tokamuro +; See the PS/Tk license for conditions of use. + +(add-to-load-path "../") + +(use-modules (pstk) + (ice-9 format)) + +(tk-start) + +(tk/wm 'title tk "Slider") +(tk/wm 'resizable tk 0 0) + +(tk 'configure 'background: "#ffffff") + +(ttk-map-widgets 'all) +(ttk/set-theme "clam") + +(let* ((entry (tk 'create-widget 'entry + 'width: 20)) + (slider (tk 'create-widget 'scale + 'from: 0 + 'to: 100 + 'command: (lambda (x) + (entry 'delete 0 "end") + (entry 'insert 0 (format #f "~,2f" x)))))) + (tk/grid entry 'row: 0 'columnspan: 4 'sticky: 'ew 'padx: 20 'pady: 10) + (tk/grid slider 'row: 1 'columnspan: 4 'sticky: 'ew 'padx: 20 'pady: 10) + (tk-event-loop)) + diff --git a/images/slider.png b/images/slider.png Binary files differ.