Debian Codegraph @

GUI/PWgui/README.developer

raw
1 ==============================================================================
2 * * * README file for PWgui (and PWscf) developers * * *
3 ==============================================================================
4
5
6 *** see INSTALL.svn for how to run SVN version of PWgui !!!
7
8
9 FOR PWscf DEVELOPERS: UPDATING the PWgui MODULES
10 --------------------------------------------------
11
12 If some new variables have been added to a given PWscf program, please
13 update corresponding module definition files, which are located in
14 modules/ directory.
15
16 Before committing changes to SVN repository, please check that the
17 updated module works!!! If you face troubles, please consult
18 [email protected].
19
20
21 WHAT IS A "MODULE" IN PWgui
22 -----------------------------
23
24 A "module" stands for the definition of the input of a given PWscf
25 program. The description of the input is specified using the
26 GUIB-definition syntax. Such a description provides two items: (i) it
27 defines the input-syntax, and concomitantly (ii) defines the GUI.
28
29 The modules are located in the modules/ directory. Each module is
30 located in its own directory. For example the PW.X module is located
31 in directory modules/pw. The following files are located therein:
32
33 * pw.tcl - main module definition file, the rest of the
34 files are source from here
35 * pw-event.tcl - implementation of event-driven mechanism
36 * pw-help.tcl - help file describing all the pw.x variables
37 * commands.tcl - auxiliary commands used by file pw.tcl
38
39 Hereafter such files are called "module definition files".
40
41
42 HOW TO ADD A NEW MODULE TO PWgui
43 ----------------------------------
44
45 Let's say we want to add a new module named "mymodule". We have to
46 perform two tasks:
47
48 (i) Write the Module Definition Files
49
50 Create a directory: modules/mymodule, and therein a file
51 mymodule.tcl. If needed create also files: mymodule-event.tcl,
52 mymodule-help.tcl, and commands.tcl.
53
54 For the syntax of the module definition file see some existing
55 modules. For example, see files in modules/pp (easy example), or in
56 modules/pw (complex example). For further documentation see also:
57 http://www-k3.ijs.si/kokalj/guib/documentation.html.
58
59 (ii) Inform the GUI About New Module
60
61 Now we should edit the file src-tcl/pwscf.itcl, and add the following
62 line on the proper place (search for addModule string):
63
64 $gui addModule module mymodule "MyModule.X" \
65 [file join $env(PWGUI) modules mymodule mymodule.tcl] {
66 {{MyModule.X Input File} {*.my.inp}}
67 }
68
69
70 We can also add extra documentation for the module. Let say that we
71 have an INPUT_MYMODULE file. We can either copy this file to directory
72 doc/pwdoc or alternatively we make a symbolic link. Then we edit a
73 Makefile and insert the INPUT_MYMODULE support (the purpose is to
74 convert INPUT_MYMODULE to INPUT_MYMODULE.html). Now we execute: make
75 input_html (this will create the INPUT_MYMODULE.html file). Finally,
76 we can edit the src-tcl/pwscf.itcl, and add the following line on the
77 proper place (search for addHelp string):
78
79 $gui addHelp help mymodule "MyModule.X Input Syntax" \
80 [file join $env(PWGUI) doc pwdocs INPUT_MYMODULE.html]
81
82
83 --
84 Anton Kokalj ([email protected]), Tue Feb 17 08:41:05 CET 2004