Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents
Next: Recipes Up: NOTE 236 - DISH: User's Manual Previous: Bulk Processing of data in new DISH

Operation template

1) If the operation should be automatically added, add the following line to 
	dish.g (to the function private.defaultops):
	public.addop('filename.g','filename') where filename is the ctor.
   If want to add the operation after creation of the new DISH tool, it can be 
	added as above by calling your toolname's addop function.
2) Write the following:

filename.g                              filenamegui.g
include 'filenamegui.g'                 include 'widgetserver.g'
const filename := function(ref itsdish) const filenamegui:=subsequence(parent,
                                          itsop, logcommand, widgetserver=dws)
{                                       { 
                                           widgetset.tk_hold();
        public := [=];
        private:= [=];                     private := [=];
                                           private.op := itsop;
                                           private.logcommand := logcommand

                                           private.outerFrame := 
                                                   widgetset.frame(parent,
                                                   side='top',relief='ridge');
                                           private.labelFrame :=
                                                   dws.frame(private.outerframe,
                                                   expand='x');
                                           private.mainLabel := 
                                                   dws.label(private.labelframe,
                                                   'main label text');
                                           private.combo := 
                                                dws.combobox(private.outerframe,
                                                'Title',autoinsertorder='head',
                                                canclearpopup=T,help='help');
                                           # more GUI construction
                                           private.bottomFrame:=
                                           private.leftPad:=
                                           private.applyFrame:=
                                           private.applyButton:=
                                           private.rightPad:=
                                           private.dismissButton:=
                                           etc...
                                           # handlers for buttons
                                           whenever private.dismissbutton->press
                                           whenever private.applyButton->press
					  
#       def: start w/o GUI
        private.gui := F;
        private.dish := itsdish;
        ...other initial declarations...

        ...other private functions...

        public.apply:=function(){}	  
*       public.dismissgui:=function(){}
*       public.done:=function(){}          self.done:=function(){
*       public.getstate:=function(){}           wider private,self;
*       public.gui:=function(){}                self->done();
*       public.opmenuname:=function(){}	   }
*       public.opfuncname:=function(){}	   self.outerframe:=function(){
*       public.setstate:=function(){}           wider private;
        public.debug:=function(){               return private.outerFrame;
                wider private;             }
                return private;}           ...other functions to do things...

                                           junk:=dws.tk_release();

        return public;                     #self auto returned
}                                          }

* indicates must be present (to pass verifyOp)


next up previous contents
Next: Recipes Up: NOTE 236 - DISH: User's Manual Previous: Bulk Processing of data in new DISH   Contents
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15