Making DirectFrame accept mouse press/release events

Thanks for the previous help, but I’ve hit another snag. I’m trying to make a DirectFrame object that can be dragged around the screen, but I can’t manage to make it accept mouse presses and releases. The code I’m using is:

class DraggableDirectFrame(DirectFrame):
  def __init__(self, *vargs, **kvargs):
    DirectFrame.__init__(self, *vargs, **kvargs)
    self.bind(DGG.B1PRESS, self.dragStart)
    self.bind(DGG.B1RELEASE, self.dragStop)
    self.initialiseoptions(DraggableDirectFrame)

  # (drag code follows)

I do not recognize the DGG.* events. Are they the same as the mouse* events described here:
panda3d.org/manual/index.php/Mouse_Support
?

If you get it to work, it would be cool if you could post it on this forum!

DGG stuff is imported as:

from direct.gui import DirectGuiGlobals as DGG

also, I found the solution.

class DraggableDirectFrame(DirectFrame):
  def __init__(self, *vargs, **kvargs):
    DirectFrame.__init__(self, state=DGG.NORMAL, *vargs, **kvargs)
    self.bind(DGG.B1PRESS, self.dragStart)
    self.bind(DGG.B1RELEASE, self.dragStop)
    self.initialiseoptions(DraggableDirectFrame) 

  # drag code from DirectGuiBase.py follows