help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dialog boxes


From: Kevin Rodgers
Subject: Re: dialog boxes
Date: Fri, 17 Sep 2004 09:47:29 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Bruce Ingalls wrote:
> I discovered that I can use VBScript to enumerate available printers.
> There may even be a way to query the w32 registry via Emacs for the
> system default printer.
>
> I'd like to present users with a dialog box, to choose a printer.
> Since Emacs allows certain widgets/Windows controls in Customize
> buffers, and Emacs allows popups, can I put radio buttons and/or check
> boxes into a popup dialog box?
>
> Otherwise, some sample code, which makes it easy to populate a Customize
> buffer with options and a submit button, to act like a dialog box, would
> be appreciated.
>
> Who knows? Perhaps it will be possible to scan /etc/printcap or
> Gnome/KDE settings, to choose a printer at runtime.

A long time ago I wrote printers.el, which does exactly that.  It
needs to be updated to set the printer-name variable, which was
introduced in Emacs 20.  Google for:

From: address@hidden (Kevin Rodgers)
Subject: printers.el 1.6
Newsgroups: gnu.emacs.sources
Date: 1995/08/21
Message-ID: <address@hidden>

Here's the commentary:

;;;; printers.el -- An interface to `lpstat` (SysV) and /etc/printcap (BSD).

;;; Description:
;;;
;;; Determines the default printer and the list of available printers
;;; from the LPDEST environment variable and the `lpstat` command (SysV)
;;; or from the PRINTER environment variable and the /etc/printcap file
;;; (BSD), and stores them in the `system-printer-default' and `system-
;;; printer-list' variables.
;;;
;;; The list of available printers is used by the `read-printer'
;;; function to provide completion, which is used in turn by the
;;; `set-system-printer-default' command to set the default printer used
;;; by the `lp` (SysV) and `lpr` (BSD) commands.  The `set-system-printer-
;;; list' command can be used to re-initialize the list, in case the
;;; system printers have been reconfigured since printers.el was loaded.
;;;
;;; On BSD systems, the `system-printer-field' variable controls whether
;;; all the `|'-separated names for each printer in /etc/printcap are
;;; listed in `system-printers'.

--
Kevin Rodgers



reply via email to

[Prev in Thread] Current Thread [Next in Thread]