1# ------------------------------------------------------------------------
2#  initialize the ::guib namespace and set the library & version variables
3# ------------------------------------------------------------------------
4
5# ------------------------------------------------------------------------
6#  load Tcl/Tk + [Incr Tcl]/[Incr Tk]/[Incr Widgets]
7# ------------------------------------------------------------------------
8
9package require Tk
10#package require Itcl
11if { [catch {package require Itk}] } {
12    package require itk
13}
14package require Iwidgets
15
16# We need to import all of the itcl functions into the global
17# namespace.
18namespace import -force itcl::*
19
20
21namespace eval ::guib {
22    namespace export module
23
24    variable library [file dirname [info script]]
25    variable version [gets [open [file join $library VERSION] r]]
26
27    variable options
28    variable module
29    variable library
30
31    # associative-dimension "settings" is used for user-spefic seetings
32
33    variable settings
34
35    #------------------------------------------------------------------------
36    # CONVENTION for settings() array elements:
37    #------------------------------------------------------------------------
38    # The elements of the settings() array have the following names:
39    # settings(WHAT.details). For example, all elements that are
40    # dealing with filename, have the following names:
41    # settings(FILENAME.*)
42    #------------------------------------------------------------------------
43
44    # regular expresion for the for the endlist-string
45    set settings(NAMELIST.end_regexp) {^ *&end|^ */}
46
47    # string to write for the end-of-namelist
48    set settings(NAMELIST.end_string) { /}
49
50    # case-sensitivity of namelists variable names (i.e., _nocase like
51    # the "-nocase" tcl-option)
52    set settings(NAMELIST.varname_nocase) 1
53
54    # format for printing namelist's variables names
55    set settings(NAMELIST.varname_format) {   %15s}
56
57    # support for undefined namelist variables (0|1)
58    set settings(NAMELIST.variable_support_undefined) 0
59
60    # do we quotre the string [charagetr*(*)] type of variables (0|1)
61    set settings(NAMELIST.quote_strings) 1
62    set settings(NAMELIST.quote_char)    '
63
64    # case-sensitivity of input (0|1)
65    set settings(INPUT.nocase) 0
66
67    #---
68    # For case-insensitive input ( $settings(INPUT.nocase) == 1 ):
69
70    #   print the keywords as "upper|lower|unchanged"
71    set settings(INPUT.nocase_preference_keyword)  upper; # not USED yet
72    #   print the variable values as "upper|lower|unchanged"
73    set settings(INPUT.nocase_preference_varvalue) unchanged; # not USED yet
74
75    #---
76
77    # whether to add a trailing slash to dirnames
78    set settings(DIRNAME.trailing_slash)  0
79
80    # whether to use only file-tail for filenames
81    set settings(FILENAME.only_tail)  0
82
83
84    # ------------------------------------------------------------------------
85    #  IMAGES
86    # ------------------------------------------------------------------------
87
88    # create toolbar images ...
89
90    image create photo filenew -format gif \
91	-file [file join $env(GUIB) images filenew2.gif]
92
93    image create photo fileopen -format gif \
94	-file [file join $env(GUIB) images fileopen2.gif]
95
96    image create photo filesave -format gif \
97	-file [file join $env(GUIB) images filesave2.gif]
98
99    image create photo filesaveas -format gif \
100	-file [file join $env(GUIB) images filesaveas2.gif]
101
102    image create photo fileclose  -format gif \
103	-file [file join $env(GUIB) images fileclose2.gif]
104
105    image create photo exitApp -format gif \
106	-file [file join $env(GUIB) images exit2.gif]
107}
108
109
110# ------------------------------------------------------------------------
111#  load TclLib:
112#               we only need the cmdline package of TclLib
113# ------------------------------------------------------------------------
114lappend auto_path [file join $guib::library external lib]
115package require cmdline 1.2
116
117
118#------------------------------------------------------------------------
119# load TCLU & TKU library
120#------------------------------------------------------------------------
121lappend auto_path [file join $guib::library lib]
122package require tclu
123package require tku
124
125#------------------------------------------------------------------------
126# load GUIB
127#------------------------------------------------------------------------
128lappend auto_path [file join $guib::library src]
129
130
131# ------------------------------------------------------------------------
132#  provide package GUIB
133# ------------------------------------------------------------------------
134package provide Guib $guib::version
135
136
137namespace eval ::guib {
138
139    # we should source the file guib-keywords-def.tcl in order to load
140    # the definiton of GUIB keywords options
141    source [file join $library src guib-keywords-def.tcl]
142
143    # we should source the file widgets.itcl in order to load the
144    # definiton of ::guib::widgets namespace variables !!!
145    source [file join $library src widgets.itcl]
146
147    source [file join $library src keywidgets.itcl]
148
149    #source [file join $library src keywordObj.itcl]
150    #source [file join $library src moduleObj.itcl]
151}
152
153