guile-pstk

A Tk interface for Guile (A fork of (and hopefully a future merge?) https://github.com/kikyTokamuro/guile-pstk/).
Log | Files | Refs | README | LICENSE

themes.scm (772B)


      1 ; PS/Tk Example Program "Tile Themes"
      2 ; Copyright (C) 2021-2022 Daniil Archangelsky aka Kiky Tokamuro
      3 ; Copyright (C) 2007 Nils M Holm
      4 ; See the PS/Tk license for conditions of use.
      5 
      6 (add-to-load-path
      7  (string-append
      8   (dirname (current-filename))
      9   "/../"))
     10 
     11 (use-modules (pstk))
     12 
     13 (tk-start)
     14 (ttk-map-widgets 'all)
     15 (let ((button
     16        (lambda (x)
     17          (let ((b (tk 'create-widget 'button
     18                       'text: (string-append "Select " x " theme")
     19                       'command: (lambda ()
     20                                   (ttk/set-theme x)))))
     21            (tk/pack b 'side: 'top 'fill: 'x)))))
     22   (map button (ttk/available-themes))
     23   (tk/pack (tk 'create-widget 'button
     24                'text: "Exit" 'command: tk-end)
     25            'fill: 'x)
     26   (tk-event-loop))