
# Load all the packages that make up Tkined. Note, the order is
# important here because the Tkined package initializes the search
# path so that the Tcl modules are found automatically.

package require Tcl 7.5
package require Tk 4.1 

package require Tkined 1.4
package require TkinedCommand 1.4
package require TkinedDiagram 1.4
package require TkinedDialog 1.4
package require TkinedEditor 1.4
package require TkinedEvent 1.4
package require TkinedHelp 1.4
package require TkinedMisc 1.4
package require TkinedObjects 1.4
package require TkinedTool 1.4

# I dont like the fat font Tk uses per default. So here 
# is good old fixed font.

option add Tkined*Text.font        fixed startupFile

# Read the site specific initialization file.

if [file exists [file join $tkined(library) site init.tcl]] {
    source [file join $tkined(library) site init.tcl]
}

# And here we start. Unmap the . widget and start an editor
# for each file metioned in the command line.

wm withdraw .

foreach f $argv {
    if [file readable $f] {
	set v [EDITOR]
	$v load $f
	$v filename [file tail $f]
        lappend views $v
    }
}
if {! [info exists views]} {
    set views [EDITOR]
}

if {[info exists geometry]} {
    foreach view $views {
	puts "should set geometry of $view to $geometry"
    }
}
