On Thu, Jan 11, 2001 at 05:08:42PM +0100, Jan Ulrich Hasecke wrote:
> Mh I tried the following:
> 
> 1. In "Preferences" I added a Converter DVI --> Fax
> 2. In the field Converter I put 'faxspool $$i' (without the quotes)
> 3. I clicked on the new-created menu-item "Fax..." and all was done
> 
> 4. But the Fax was not sended because a did not specified any
> telephone-number. 
> 
> How can I make Lyx pop-up a small window to type in the number or the
> shortcut from ~/.faxnrs faxspool understands?

You use a {tcl,python,perl}/tk script:

Put the attached fax.py script in your path, and then
change the dvi->fax converter command to 'fax.py $$i'.

#!/usr/bin/python
from Tkinter import *
import os,sys

class MyDialog:
    def __init__(self, parent):
        Label(parent, text="Enter phone number").pack()

        self.e = Entry(parent)
        self.e.pack(padx=5)
        self.e.focus_set()

        Button(parent, text="Send", command=self.send).pack(pady=5)

    def send(self):
        phone = self.e.get()
        if len(phone) == 0:
            return
        os.system("faxspool " + phone + " " + sys.argv[1])
        sys.exit(0)

root = Tk()
MyDialog(root)
mainloop()

Reply via email to