guile-pstk

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

commit 1d55400469403b711a18411a54e13cda9c7c67cd
parent e8ea3aac2c978ed66d3a673c5e397d028c23695a
Author: KikyTokamuro <kiky.tokamuro@yandex.ru>
Date:   Sat, 12 Mar 2022 16:36:09 +0300

Added new example 'Canvas'

Diffstat:
MREADME.md | 1+
Aexamples/canvas.scm | 38++++++++++++++++++++++++++++++++++++++
Aimages/canvas.png | 0
3 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -16,6 +16,7 @@ PS/TK version (http://mirror.informatimago.com/scheme/www.t3x.org/pstk/index.htm | [themes.scm](./examples/themes.scm) | ![themes](./images/themes.png) | | [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) | ### Tested on ``` diff --git a/examples/canvas.scm b/examples/canvas.scm @@ -0,0 +1,38 @@ +; PS/Tk Example Program "Canvas" +; Copyright (C) 2022 Daniil Archangelsky aka Kiky Tokamuro +; See the PS/Tk license for conditions of use. + +(add-to-load-path "../") + +(use-modules (pstk)) + +(tk-start) + +(tk/wm 'title tk "Canvas") +(tk/wm 'resizable tk 0 0) + +(let* ((canvas (tk 'create-widget 'canvas + 'background: "#ffffff" + 'width: 300 + 'height: 200))) + (canvas 'create 'rect 30 10 120 80 + 'outline: "#fb0" + 'fill: "#fb0") + (canvas 'create 'oval 110 30 210 80 + 'outline: "#000" + 'fill: "#000") + (canvas 'create 'arc 30 200 90 100 + 'start: 0 + 'extent: 210 + 'outline: "#ab1" + 'fill: "#ab1") + (canvas 'create 'text 190 150 + 'font: "Hack 20" + 'fill: "#30bc22" + 'text: "guile-pstk") + (canvas 'create 'line 50 100 500 100 + 'fill: "#2f55ff" + 'width: 5) + (tk/pack canvas) + (tk-event-loop)) + diff --git a/images/canvas.png b/images/canvas.png Binary files differ.