Comment 3 for bug 394041

Revision history for this message
Stani (stani) wrote :

I went for solution 3 which is provide all the GetDefaultPath methods with the same set of arguments. Thanks Nadia for analyzing that saved me time. About the empty dropdown list that is the intended behaviour. The drop down list autocompletes the current text. So if the text is Default and you don't have fonts which start with Default, it is completely normal the dropdown is empty. To check you should empty the font field and than all the available fonts will popup. Please test this, Dr Slony. If you start typing it will filter the list of fonts down to the partial font input.
Thanks for reporting this bug, please test if it is fixed for you from the latest bzr

$ bzr diff
=== modified file 'phatch/pyWx/lib/popup.py'
--- phatch/pyWx/lib/popup.py 2009-06-23 14:43:21 +0000
+++ phatch/pyWx/lib/popup.py 2009-07-01 16:26:56 +0000
@@ -405,10 +405,10 @@
         super(DictionaryFileCtrl,self).__init__(parent,value,size,
             choices = choices, **extra)

- def GetDefaultPath(self):
- value = self.path.GetValue()
- #default_path = os.path.dirname(self.dictionary.get(value,value))
- default_path = self.dictionary.get(value,value)
+ def GetDefaultPath(self,default_path=None):
+ if default_path is None:
+ value = self.path.GetValue()
+ default_path = self.dictionary.get(value,value)
         return super(DictionaryFileCtrl,self).GetDefaultPath(default_path)

 class AutoCompleteDictionaryFileCtrl(DictionaryFileCtrl):
@@ -426,10 +426,10 @@
     _label = _t('Fonts')
     _busy_cursor = True

- def GetDefaultPath(self):
- value = self.path.GetValue()
- #default_path = os.path.dirname(font_dictionary().get(value,value))
- default_path = font_dictionary().get(value,value)
+ def GetDefaultPath(self,default_path=None):
+ if default_path is None:
+ value = self.path.GetValue()
+ default_path = font_dictionary().get(value,value)
         if not os.path.isdir(default_path.strip()):
             for path in FONT_PATHS:
                 if os.path.isdir(path):

$ bzr commit -m "fix GetDefaultPath"
Committing to: /media/16gb/sync/python/phatch/trunk/
modified phatch/pyWx/lib/popup.py
Committed revision 930.