wxSpinCtrl/wxSlider with Floats and FileDialog

Heyho!

I've got two questions:
1. Is there a way to use a wxSpinCtrl or a wxSlider with float values? So far it seems to me that these two only handles int values.
2. How can I catch a wxKeyEvent in a wxFileDialog? This code won't work:

from wxPython.wx import wxFileDialog, EVT_KEY_UP
from wxPython.lib.evtmgr import eventManager

class FileDialog(wxFileDialog):

     def __init__(self, *args, **kwargs):
         apply(wxFileDialog.__init__,(self,) + args, kwargs)
         eventManager.Register(self.onKeyUp, EVT_KEY_UP, self)

     def onKeyUp(self, evt):
         print evt
         evt.Skip()

Thanks in advance! You guys and gals rule, this is a very helpful and friendly mailinglist!

Stay Rude!
Wolfram

Wolfram Kraus wrote:

Heyho!

I've got two questions:
1. Is there a way to use a wxSpinCtrl or a wxSlider with float values? So far it seems to me that these two only handles int values.

Yes they are only designed to be used with ints, however with a bit of work you can make them cycle through anything, floats, lists of strings, whatever. For example, use a wxSpinButton and a wxTextCtrl and then in response to the events from the spin button update the text ctrl however you wish.

2. How can I catch a wxKeyEvent in a wxFileDialog? This code won't work:

On Windows you can't. This is because the wxFileDialog and other "common dialogs" are not true wxDialogs but are just wrappers around platform API functions.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!