#!/usr/local/bin/ruby
=begin
/****************************************************************************
** $Id: rubyedit2.rb,v 1.1.1.2 2000/11/14 17:05:08 horie Exp $
**
** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
**
** This file is part of an example program for Qt.  This example
** program may be used, distributed and modified without limitation.
**
*****************************************************************************/
=end
#SETTINGS
#Where tool bar pixmaps are
$PIXDIR = ".//"

require "qt2"
include Qt2

require "rubyedit2_lib.rb"


    a = QApplication.new([$0] + ARGV)
    linNum = 0
    for i in 0..(ARGV.size - 1)
       if ARGV[i][0].chr == "-"
          # Process options
       elsif ARGV[i][0].chr == "+"
         linNum = ARGV[i].to_i
       else
         fname = ARGV[i]
       end
    end
    mw = REditorWindow.new
    a.setMainWidget(mw)
    mw.setCaption( "Document 1" )
    mw.resize(400,300)
    mw.show
    Qt2::connect( a, QSIGNAL("lastWindowClosed()"), a, QSLOT("quit()") )
    if(!fname.nil?)
      mw.loadFile (fname)
    end
    if(linNum != 0)
      mw.gotoLine(linNum - 1)
    end
    a.exec
