;;;;
;;;; entry1.stk                 -- GTklos Entry Demo
;;;;
;;;; Copyright © 2000-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: 25-Aug-2000 11:25 (eg)
;;;;

(include "demos-utils.stk")

(define demo-message "
Simple Entry Demo

This is a demonstration of the entry widget. In this demo,
you can use the two check buttons as toggles. The first one
allows/forbids entry edition. The second one, makes the text
in the entry visible/invisible.
")


(define (main args)
  (let* ((window (make <demo-window>
                   #:title "STklos Entry"
                   #:file "entry1"
                   #:width 600
                   #:message demo-message))
         (entry  (make <entry>
                   #:max-length 50
                   #:value "Hello, world"
                   #:parent window))
         (hbox   (make <hbox>
                   #:parent window))
         (check1 (make <check-button>
                   #:text "Editable"
                   #:parent hbox
                   #:value #t
                   #:command (lambda (w ev)
                               (set! (text-editable entry) (value w)))))
         (check2 (make <check-button>
                   #:text "Visible"
                   #:parent hbox
                   #:value #t
                   #:command (lambda (w ev)
                               (set! (text-visibility entry) (value w))))))

    (gtk-main)
    0))
