X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/acb0429704692845d28c420f01d678e7f69e59b8..6f9fcc8220a1593f928f89c9a864acf1aafdcf1c:/wxPython/wx/lib/filebrowsebutton.py

diff --git a/wxPython/wx/lib/filebrowsebutton.py b/wxPython/wx/lib/filebrowsebutton.py
index 2da119cfbc..0a492fd7fc 100644
--- a/wxPython/wx/lib/filebrowsebutton.py
+++ b/wxPython/wx/lib/filebrowsebutton.py
@@ -90,7 +90,10 @@ class FileBrowseButton(wx.Panel):
 
         # try to set the background colour
         try:
-            self.SetBackgroundColour(self._bc)
+            #Question: is this still needed on other platforms?
+            #It should have transparent background on Mac
+            if wx.Platform != "__WXMAC__":
+                self.SetBackgroundColour(self._bc)
         except:
             pass
 
@@ -343,18 +346,27 @@ class DirBrowseButton(FileBrowseButton):
                  dialogTitle = '',
                  startDirectory = '.',
                  changeCallback = None,
-                 dialogClass = wx.DirDialog):
+                 dialogClass = wx.DirDialog,
+                 newDirectory = False):
         FileBrowseButton.__init__(self, parent, id, pos, size, style,
                                   labelText, buttonText, toolTip,
                                   dialogTitle, startDirectory,
                                   changeCallback = changeCallback)
         self.dialogClass = dialogClass
+        self.newDirectory = newDirectory
     #
 
     def OnBrowse(self, ev = None):
+        style=0
+
+        if self.newDirectory:
+          style|=wx.DD_NEW_DIR_BUTTON
+
         dialog = self.dialogClass(self,
                                   message = self.dialogTitle,
-                                  defaultPath = self.startDirectory)
+                                  defaultPath = self.startDirectory,
+                                  style = style)
+
         if dialog.ShowModal() == wx.ID_OK:
             self.SetValue(dialog.GetPath())
         dialog.Destroy()