mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Callbacks on slider
This commit is contained in:
parent
2f5ae9d87f
commit
26c1fb4553
@ -252,6 +252,8 @@ class SliderWidget(Pmw.MegaWidget):
|
||||
else:
|
||||
createSlider(interior)
|
||||
self._widget['command'] = self._firstScaleCommand
|
||||
self._widget.bind('<ButtonRelease-1>', self._scaleBtnRelease)
|
||||
self._widget.bind('<ButtonPress-1>', self._scaleBtnPress)
|
||||
|
||||
# Check keywords and initialise options.
|
||||
self.initialiseoptions(SliderWidget)
|
||||
@ -391,6 +393,15 @@ class SliderWidget(Pmw.MegaWidget):
|
||||
elif self._fUpdate:
|
||||
self._updateValue(event)
|
||||
|
||||
def _scaleBtnPress(self, event):
|
||||
if self['preCallback']:
|
||||
apply(self['preCallback'], self['callbackData'])
|
||||
|
||||
def _scaleBtnRelease(self, event):
|
||||
# Do post callback if any
|
||||
if self['postCallback']:
|
||||
apply(self['postCallback'], self['callbackData'])
|
||||
|
||||
def _widgetBtnRelease(self, event):
|
||||
# Do post callback if any
|
||||
if self._fUpdate and self['postCallback']:
|
||||
|
Loading…
x
Reference in New Issue
Block a user