# File rtex.rb, line 1419
def gui( tex )
        if !tex.is_a?(Chain)
                raise 'Internal error: Gui get no Chain'
        end
        ph = {'padx' => 10, 'pady' => 10 }
        #p = proc{ puts @text.value }
        
        root   = TkRoot.new{ title "rtex: TeX-Cockpit" }
        top    = TkFrame.new(root)
        @text = TkVariable.new
        @text.value=tex.filename + '.tex'
        @text.pack( top, ph )
        #tex.filename is the file without extension
        TkLabel.new(top) {text tex.filename + '.tex'; pack(ph) }
        #~ @entry      = TkEntry.new(top, 'textvariable' => @text )
        #~ @entry.pack(ph)
        #~ TkButton.new(top) { text 'Start';   command proc{ tex.execute() }; pack ph}
        TkButton.new(top) { text 'Exit';       command proc{exit}; pack ph } #+ { 'side' => 'left' } }
        top.pack('fill'=>'both', 'side'=>'top')
        
        Tk.mainloop
end