diff --git a/GUI/PWgui/init.tcl b/GUI/PWgui/init.tcl new file mode 100644 index 000000000..4e5f8dfe7 --- /dev/null +++ b/GUI/PWgui/init.tcl @@ -0,0 +1,32 @@ +# +# Initialization stuff for PWgui +# + +package require Guib 0.3.0 + +namespace eval ::pwscf { + variable pwscf + variable settings + + set pwscf(PWD) [pwd] +} + +# define here all pwscf's namespaces ... +namespace eval ::pwscf::edit { + variable edit +} +namespace eval ::pwscf::menustate {} +namespace eval ::pwscf::view {} +namespace eval ::pwscf::run { + variable run + set run(mode) nonblocking ; # possibilities: nonblocking || background +} + +# load settings file ... +source $env(PWGUI)/pwgui.settings +if { [file exists $env(HOME)/.pwgui/pwgui.settings] } { + # overwritte default settings by user-settings + source $env(HOME)/.pwgui/pwgui.settings +} + +lappend auto_path [file join $env(PWGUI) src] diff --git a/GUI/PWgui/pwgui.tcl b/GUI/PWgui/pwgui.tcl index 761ba3e6c..d68c75917 100644 --- a/GUI/PWgui/pwgui.tcl +++ b/GUI/PWgui/pwgui.tcl @@ -43,34 +43,14 @@ if { [info exists env(PWGUI)] } { exit } -package require Guib 0.3.0 +# +# all initialization stuff should go into init.tcl +# +source [file join $env(PWGUI) init.tcl] + +# +# now go-ahead: launch the application +# wm withdraw . bind . ::guib::exitApp - -namespace eval ::pwscf { - variable pwscf - variable settings - - set pwscf(PWD) [pwd] -} - -# define here all pwscf's namespaces ... -namespace eval ::pwscf::edit { - variable edit -} -namespace eval ::pwscf::menustate {} -namespace eval ::pwscf::view {} -namespace eval ::pwscf::run { - variable run - set run(mode) nonblocking ; # possibilities: nonblocking || background -} - -# load settings file ... -source $env(PWGUI)/pwgui.settings -if { [file exists $env(HOME)/.pwgui/pwgui.settings] } { - # overwritte default settings by user-settings - source $env(HOME)/.pwgui/pwgui.settings -} - -lappend auto_path [file join $env(PWGUI) src] source [file join $env(PWGUI) src pwscf.itcl]