home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / p / python / !Python / Lib / RiscLib / py / toolbox < prev    next >
Encoding:
Text File  |  1996-04-09  |  1.0 KB  |  40 lines

  1. # Toolbox interface
  2.  
  3. from swi import *
  4.  
  5. mfile=block(4)
  6. idblock=block(6)
  7.  
  8. class TBObject:
  9.       def __init__(self,name):
  10.           if type(name)==type(0):
  11.              self.id=name
  12.           else:
  13.              self.id=swi(0x64ec0,"0s;i",name)
  14.       def delete(self):
  15.           swi(0x64ec1,"0i",self.id)
  16.       def show(self,flags=0,parid=0,pcid=-1):
  17.           swi(0x64ec3,"ii00ii",flags,self.id,parid,pcid)
  18.       def hide(self):
  19.           swi(0x64ec4,"0i",self.id)
  20.       def getstate(self):
  21.           return swi(0x64ec5,"0i;i",self.id)
  22.       def setclienthandle(self,handle):
  23.           swi(0x64ec7,"0ii",self.id,handle)
  24.       def getclienthandle(self):
  25.           return swi(0x64ec8,"0i;i",self.id)
  26.       def getclass(self):
  27.           return swi(0x64ec9,"0i;i",self.id)
  28.  
  29. def initialise(wmsgs,tcodes,dname):
  30.     global mfile,idblock,wversion,thandle,sarea
  31.     msgadr=wmsgs.start
  32.     codeadr=tcodes.start
  33.     if wmsgs[0]==0:
  34.        msgadr=0
  35.     if tcodes[0]==0:
  36.        codeadr=0
  37.     wversion,thandle,sarea=\
  38.      swi(0x64ecf,"0iiisbb;iii",310,msgadr,codeadr,dname,mfile,idblock)
  39.  
  40.