;;;;
;;;; frame.stk  -- GTklos Frame Demo
;;;;
;;;; Copyright © 2001-2022 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation; either version 2 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;;; USA.
;;;;
;;;;           Author: Erick Gallesio [eg@unice.fr]
;;;;    Creation date: 29-Jul-2001 18:17 (eg)
;;;;

(include "demos-utils.stk")


(define *message* "
Frame Demonstration

A frame is container with a (optional) border and a (optional) title.
The title can be placed anywhere on the top border.
Furthermore, we use here various shadows for the frame.
")


(define (make-frame parent shadow title justify)
  (let ((frame (make <vframe> #:parent parent #:shadow shadow :padding 20)))
    (when title
      (slot-set! frame 'title title)
      (slot-set! frame 'xalign justify))
    (make <label> #:text (format "shadow is '~A'" shadow) :parent frame)))
          ;;#:parent (list frame #:padding 20))))

(define (main args)
  (let* ((win (make <demo-window> #:title "Frame Demo" #:width 450
                    #:file "frame" #:border-width 10
                    #:message *message* #:padding 5))
         (box (make <vbox> #:padding 5 #:parent win)))

    ;; Build several frames
    (make-frame box 'in #f 0.0)
    (make-frame box 'out " LEFT " 0.05)
    (make-frame box 'etched-in " CENTER " 0.5)
    (make-frame box 'etched-out " RIGHT " 0.95)
    (make-frame box 'none #f 0.0)
    ;; Run
    (gtk-main)))
