Re: [Q]: Choicebox composite widget ??

From: Erick Gallesio <eg_at_kaolin.unice.fr>
Date: Fri, 14 Oct 1994 11:29:40 +0000

Hereafter is a little fine demo of composite widget which was provided by
Drew.Whitehouse_at_anu.edu.au . It will be in the Example directory of next
release.

;;
;; a quick demo of the composite widgets
;;
(require "Filebox")
(require "Toplevel")
(require "Choicebox")
(require "Defbutton")
(require "Paned")
(require "Scrollbox")

;;
;; a quick demo of the composite widgets
;;
(require "Filebox")
(require "Toplevel")
(require "Choicebox")
(require "Defbutton")
(require "Paned")
(require "Scrollbox")


(define main-frame (make <Frame>))
(define title (make <Label> :parent main-frame :text "Composite Widgets Demo"))
(define button-box (make <Frame> :parent main-frame :geometry "200x100"))
(define quit (make <Button> :parent main-frame
                   :text " quit "
                   :command '(destroy *root*)))

(define composite-widgets '(Choicebox
                            Defbutton
                            Filebox
                            Lentry
                            Paned
                            Scrollbox))
(for-each (lambda (x)
            (let ((cmd (string-append "(demo-" (symbol->string x) ")")))
              (pack (make <Button> :parent button-box
                          :text (symbol->string x)
                          :command cmd)
                    :fill "x" :padx 5 )))
          composite-widgets)


(pack title :fill "x" :padx 10 :pady 10 )
(pack button-box :fill "x" :padx 10 :pady 10)
(pack quit :padx 10 :pady 10 )
(pack main-frame)

(define (demo-choicebox)
  (let* ((tl (make <Toplevel>))
         (cb (make <Choice-box> :value "none for the moment" :parent tl)))
    ;; add some entries
    (for-each (lambda (x) (add-choice cb (symbol->string x)))
composite-widgets)
    (pack cb)))
        
(define (demo-defbutton)
  (let* ((tl (make <Toplevel>))
         (db (make <Default-button> :text "button" :parent tl)))
    (pack db)))
         
(define (demo-filebox)
  (make-file-box))
    
(define (demo-lentry)
  (let* ((tl (make <Toplevel>))
         (le (make <Labeled-entry> :title "title" :parent tl)))
    (pack le)))
    
(define (demo-paned)
  (let* ((tl (make <Toplevel> ))
         (hp (make <HPaned> :fraction 0.3 :geometry "300x300" :parent tl))
         (f1 (make <Label> :text "top pane" :parent (top-frame-of hp)))
         (f2 (make <Label> :text "bottom-pane" :parent (bottom-frame-of hp)))
         (vp (make <VPaned> :fraction 0.3 :geometry "300x300" :parent tl))
         (f3 (make <Label> :text "left pane" :parent (left-frame-of vp)))
         (f4 (make <Label> :text "right-pane" :parent (right-frame-of vp))))
    (pack f1 :expand #t)
    (pack f2 :expand #t)
    (pack f3 :expand #t)
    (pack f4 :expand #t)
    (pack hp)
    (pack vp)))

(define (demo-scrollbox)
  (let* ((tl (make <Toplevel>))
         (sb (make <Scroll-listbox> :parent tl)))
    ;; add some entries into the listbox
    (for-each (lambda (x)
                (insert (listbox-of sb) 0 x))
              (append composite-widgets composite-widgets))
    (pack sb)))

                -- Erick
Received on Fri Oct 14 1994 - 11:29:40 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST