Up | Button | BitBtn | SpeedButton | CheckBox | ComboBox | Control | Edit | Memo | Font | GroupBox | Label | ListBox | PageControl | Panel | RadioButton | Bevel | ScrollBox | TabSheet | WinControl | Callback | Frame | WinControl | Form | Release Notes

 

  

 
Callback

A callback is a class method called by a control on sudden events, such as when the user clicks the control, the control resizes or changes.

All callback methods has a standard signature :

  methodname(self,sender,args)

where self is the class instance, sender is the actual control calling the event and args is variable due to context/event

  class InspectionCounterPlugin(object):
    
    def __init__(self,cntr,name):
      self.name=name

      self.panel=cntr.addControl('Panel',0,0)
      self.panel.align=5  #client
      self.panel.caption='Inspections=%d' % self.count
      
      self.panel.onResize  = self.panelResize
      self.panel.onClick = self.panelClick
      

    def panelResize(self,sender,args):
      print 'panelResize',self,sender,args

    def panelClick(self,sender,args):
      print 'panelClick',self,sender,args

 

 
 

Scorpion Vision Version XII : Build 646 - Date: 20170225
Scorpion Vision Software® is a registered trademark of Tordivel AS.
Copyright © 2000 - 2017 Tordivel AS.