;;;;
;;;; menu1.stk          -- GTK+ Menu Demo
;;;;
;;;; Copyright © 2009-2021 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: 13-Aug-2009 20:56 (eg)
;;;;

(include "demos-utils.stk")

(define *menu-msg* "
Menu Bar Demo (version 2)

This demo just shows a simple menu bar with simple menus.
This time we use the <b>add-menubar-items!</b> function which
allow a simpler code (comare the source code of this version
and the same demo wher everything is done bt hand).
")


(define (action w e)
  (eprintf "You have clicked ~S\n" (text w)))


(define (main args)
  (let* ((win  (make <demo-window> #:title "Labels Demo" #:x 100 #:y 100
                     #:file "menu2" #:border-width 10 #:padding 10
                     #:message *menu-msg*))
         (mb   (make <menu-bar> #:parent win)))

    (add-items-to-menubar mb
        `(("Item 1"
             ("Item 1 / 1"   :action ,action)
             ("Item 1 / 2"   :action ,action))
          ("Item 2"
             ("Item 2 / 1"   :action ,action)
             ("Item 2 / 2"   :action ,action))
          ()                    ;; Use an empty list to make space
          ("Item 3"
             ("Item 3 / 1"   :action ,action)
             ("Item 3 / 2"   :action ,action))))
    (gtk-main)))
