2
0
Эх сурвалжийг харах

*** empty log message ***

Joe Shochet 24 жил өмнө
parent
commit
993b4582ad

+ 9 - 0
direct/src/gui/DirectEntry.py

@@ -40,6 +40,7 @@ class DirectEntry(DirectFrame):
             ('extraArgs',      [],                None),
             # Sounds to be used for button events
             ('rolloverSound',   getDefaultRolloverSound(), self.setRolloverSound),
+            ('clickSound',    getDefaultClickSound(),    self.setClickSound),
             )
         # Merge keyword options with default options
         self.defineoptions(kw, optiondefs)
@@ -105,6 +106,14 @@ class DirectEntry(DirectFrame):
             else:
                 self.guiItem.clearSound(ENTER + self.guiId)
 
+    def setClickSound(self):
+        if base.wantSfx:
+            clickSound = self['clickSound']
+            if clickSound:
+                self.guiItem.setSound(ACCEPT + self.guiId, clickSound)
+            else:
+                self.guiItem.clearSound(ACCEPT + self.guiId)
+
     def commandFunc(self, event):
         if self['command']:
             # Pass any extra args to command