home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / p / python / !Python / Lib / RiscLib / py / window < prev   
Encoding:
Text File  |  1996-02-14  |  2.3 KB  |  66 lines

  1. # Toolbox window object interface
  2.  
  3. from swi import *
  4. from toolbox import *
  5.  
  6. strblk=block(64)
  7. eblock=block(4)
  8.  
  9. class Window(TBObject):
  10.       def getwimphandle(self):
  11.           return swi(0x64ec6,"0i0;i",self.id)
  12.       def getmenu(self):
  13.           return swi(0x64ec6,"0i4;i",self.id)
  14.       def settitle(self,title):
  15.           return swi(0x64ec6,"0iis",self.id,11,title)
  16.       def setextent(self,x0,y0,x1,y1):
  17.           eblock[:]=[x0,y0,x1,y1]
  18.           swi(0x64ec6,"0iib",self.id,15,eblock)
  19.       def forceredraw(self,x0,y0,x1,y1):
  20.           eblock[:]=[x0,y0,x1,y1]
  21.           swi(0x64ec6,"0iib",self.id,17,eblock)
  22.       def writeable_setvalue(self,n,value):
  23.           swi(0x64ec6,"0iiis",self.id,512,n,value)
  24.       def writeable_getvalue(self,n):
  25.           global strblk
  26.           s=swi(0x64ec6,"0iii0;.....i",self.id,513,n)
  27.           if s>strblk.length:
  28.              strblk.resize((s+3)/4)
  29.           swi(0x64ec6,"0iiibi",self.id,513,n,strblk,strblk.length)
  30.           return strblk.nullstring()
  31.       def numberrange_getvalue(self,n):
  32.           return swi(0x64ec6,"0iii;i",self.id,833,n)
  33.       def optionbutton_setstate(self,n,value):
  34.           swi(0x64ec6,"0iiii",self.id,196,n,value)
  35.       def optionbutton_getstate(self,n):
  36.           return swi(0x64ec6,"0iii;i",self.id,197,n)
  37.       def popup_getmenu(self,n):
  38.           return swi(0x64ec6,"0iii;i",self.id,705,n)
  39.       def gadget_unfade(self,n):
  40.           f=swi(0x64ec6,"0iii;i",self.id,64,n)
  41.           swi(0x64ec6,"0iiii;i",self.id,65,n,f&0x7fffffff)
  42.       def gadget_fade(self,n):
  43.           f=swi(0x64ec6,"0iii;i",self.id,64,n)
  44.           swi(0x64ec6,"0iiii;i",self.id,65,n,f|0x80000000)
  45.       def stringset_selected(self,n,s):
  46.           if type(s)==type(0):
  47.              swi(0x64ec6,"1iiii",self.id,898,n,s)
  48.           else:
  49.              swi(0x64ec6,"0iiis",self.id,898,n,s)
  50.       def stringset_avaliable(self,n,s):
  51.           swi(0x64ec6,"0iiis",self.id,896,n,s)
  52.       def stringset_getstring(self,n):
  53.           global strblk
  54.           s=swi(0x64ec6,"0iii0;.....i",self.id,899,n)
  55.           print "s= ",s
  56.           if s>strblk.length:
  57.              strblk.resize((s+3)/4)
  58.           swi(0x64ec6,"0iiibi",self.id,899,n,strblk,strblk.length)
  59.           return strblk.nullstring()
  60.       def stringset_getindex(self,n):
  61.           return swi(0x64ec6,"1iii;i",self.id,899,n)
  62.       def gettoolbars(self):
  63.           return swi(0x64ec6,"iii;iiii",15,self.id,19)
  64.  
  65.  
  66.