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 9FOR PWscf DEVELOPERS: UPDATING the PWgui MODULES 10-------------------------------------------------- 11 12If some new variables have been added to a given PWscf program, please 13update corresponding module definition files, which are located in 14modules/ directory. 15 16Before committing changes to SVN repository, please check that the 17updated module works!!! If you face troubles, please consult 18tone.kokalj@ijs.si. 19 20 21WHAT IS A "MODULE" IN PWgui 22----------------------------- 23 24A "module" stands for the definition of the input of a given PWscf 25program. The description of the input is specified using the 26GUIB-definition syntax. Such a description provides two items: (i) it 27defines the input-syntax, and concomitantly (ii) defines the GUI. 28 29The modules are located in the modules/ directory. Each module is 30located in its own directory. For example the PW.X module is located 31in 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 39Hereafter such files are called "module definition files". 40 41 42HOW TO ADD A NEW MODULE TO PWgui 43---------------------------------- 44 45Let's say we want to add a new module named "mymodule". We have to 46perform two tasks: 47 48 (i) Write the Module Definition Files 49 50Create a directory: modules/mymodule, and therein a file 51mymodule.tcl. If needed create also files: mymodule-event.tcl, 52mymodule-help.tcl, and commands.tcl. 53 54For the syntax of the module definition file see some existing 55modules. For example, see files in modules/pp (easy example), or in 56modules/pw (complex example). For further documentation see also: 57http://www-k3.ijs.si/kokalj/guib/documentation.html. 58 59 (ii) Inform the GUI About New Module 60 61Now we should edit the file src-tcl/pwscf.itcl, and add the following 62line 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 70We can also add extra documentation for the module. Let say that we 71have an INPUT_MYMODULE file. We can either copy this file to directory 72doc/pwdoc or alternatively we make a symbolic link. Then we edit a 73Makefile and insert the INPUT_MYMODULE support (the purpose is to 74convert INPUT_MYMODULE to INPUT_MYMODULE.html). Now we execute: make 75input_html (this will create the INPUT_MYMODULE.html file). Finally, 76we can edit the src-tcl/pwscf.itcl, and add the following line on the 77proper 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-- 84Anton Kokalj (tone.kokalj@ijs.si), Tue Feb 17 08:41:05 CET 2004