all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* dialog boxes
@ 2004-09-10 17:57 Bruce Ingalls
  2004-09-10 22:05 ` Michael Slass
  2004-09-17 15:47 ` Kevin Rodgers
  0 siblings, 2 replies; 3+ messages in thread
From: Bruce Ingalls @ 2004-09-10 17:57 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: dialog boxes
  2004-09-10 17:57 dialog boxes Bruce Ingalls
@ 2004-09-10 22:05 ` Michael Slass
  2004-09-17 15:47 ` Kevin Rodgers
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Slass @ 2004-09-10 22:05 UTC (permalink / raw)


Bruce Ingalls <ingallsb@verizon._NO.SPAM_.net> writes:

>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.

At the absolute quickest and dirtiest end of the spectrum, you could
use the list you get from VB to create a list of lists, and use that
in `completing-read'.

(message "you chose printer %s"
 (completing-read
  "chose a printer: "
  (mapcar
   (lambda (elt) (list elt))
   ( <list of printers here> )) nil t))


completing-read will pop-up the "window of possibilities", which I
think you can mouse-click on to select a choice.

Not exactly what you want, but REALLY fast to implement.

-- 
Mike Slass

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: dialog boxes
  2004-09-10 17:57 dialog boxes Bruce Ingalls
  2004-09-10 22:05 ` Michael Slass
@ 2004-09-17 15:47 ` Kevin Rodgers
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Rodgers @ 2004-09-17 15:47 UTC (permalink / raw)


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: kevinr@ihs.com (Kevin Rodgers)
Subject: printers.el 1.6
Newsgroups: gnu.emacs.sources
Date: 1995/08/21
Message-ID: <9508212016.AA04940@airedale.ihsyp>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-09-17 15:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-10 17:57 dialog boxes Bruce Ingalls
2004-09-10 22:05 ` Michael Slass
2004-09-17 15:47 ` Kevin Rodgers

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.