Panda3D
Public Member Functions

EventGroup Class Reference

Inheritance diagram for EventGroup:
DirectObject

List of all members.

Public Member Functions

def __init__
def __repr__
def accept
def acceptOnce
def addEvent
def addTask
def classTree
def destroy
def detectLeaks
def doMethodLater
def getAllAccepting
def getDoneEvent
def getName
def ignore
def ignoreAll
def isAccepting
def isCompleted
def isIgnoring
def newEvent
def removeAllTasks
def removeTask

Detailed Description

This class allows you to group together multiple events and treat
them as a single event. The EventGroup will not send out its event until
all of its sub-events have occured.

Constructor & Destructor Documentation

def __init__ (   self,
  name,
  subEvents = None,
  doneEvent = None 
)
Provide a meaningful name to aid debugging.

doneEvent is optional. If not provided, a unique done event will be
generated and is available as EventGroup.getDoneEvent().

Examples:

# waits for gotRed and gotBlue, then sends out 'gotColors'
EventGroup('getRedAndBlue', ('gotRed', 'gotBlue'), doneEvent='gotColors')

# waits for two interests to close, then calls self._handleBothInterestsClosed()
# uses EventGroup.getDoneEvent() and EventGroup.newEvent() to generate unique,
# disposable event names
eGroup = EventGroup('closeInterests')
self.acceptOnce(eGroup.getDoneEvent(), self._handleBothInterestsClosed)
base.cr.closeInterest(interest1, event=eGroup.newEvent('closeInterest1'))
base.cr.closeInterest(interest2, event=eGroup.newEvent('closeInterest2'))

Member Function Documentation

def __repr__ (   self)
def accept (   self,
  event,
  method,
  extraArgs = [] 
) [inherited]
def acceptOnce (   self,
  event,
  method,
  extraArgs = [] 
) [inherited]
def addEvent (   self,
  eventName 
)
Adds a new event to the list of sub-events that we're waiting on.
Returns the name of the event. 
def addTask (   self,
  args,
  kwargs 
) [inherited]
def classTree (   self) [inherited]
def destroy (   self)
def detectLeaks (   self) [inherited]
def doMethodLater (   self,
  args,
  kwargs 
) [inherited]
def getAllAccepting (   self) [inherited]
def getDoneEvent (   self)
def getName (   self)
def ignore (   self,
  event 
) [inherited]
def ignoreAll (   self) [inherited]
def isAccepting (   self,
  event 
) [inherited]
def isCompleted (   self)
def isIgnoring (   self,
  event 
) [inherited]
def newEvent (   self,
  name 
)
Pass in an event name and it will be unique-ified for you and added
to this EventGroup. TIP: there's no need to repeat information in this event
name that is already in the name of the EventGroup object.
Returns the new event name. 
def removeAllTasks (   self) [inherited]
def removeTask (   self,
  taskOrName 
) [inherited]
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties