1
#| nokogiri-widget-dialog.jl -- simple dialogs from widgets
3
$Id: widget-dialog.jl,v 1.6 2000/09/01 20:00:04 john Exp $
5
Copyright (C) 2000 John Harper <john@dcs.warwick.ac.uk>
7
This file is part of sawfish.
9
sawfish is free software; you can redistribute it and/or modify it
10
under the terms of the GNU General Public License as published by
11
the Free Software Foundation; either version 2, or (at your option)
14
sawfish is distributed in the hope that it will be useful, but
15
WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU General Public License for more details.
19
You should have received a copy of the GNU General Public License
20
along with sawfish; see the file COPYING. If not, write to
21
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24
(define-structure sawfish.gtk.widget-dialog
26
(export widget-dialog)
33
(define (widget-dialog title spec callback
34
#!optional initial-value main-window)
36
(let* ((widget (make-widget spec))
37
(vbox (gtk-vbox-new nil box-spacing))
38
(hbox (gtk-hbox-new nil 0)))
41
(widget-set widget initial-value))
43
(gtk-box-pack-start hbox (gtk-label-new title))
44
(gtk-container-add vbox hbox)
45
(gtk-container-add vbox (widget-gtk-widget widget))
46
(gtk-widget-show-all vbox)
47
(simple-dialog title vbox
48
(lambda () (callback (widget-ref widget)))