I want to create a DirDialog that will be resizable and will not allow me to create a new directory.
I tried the following:
import wx
if __name__ == "__main__":
app = wx.PySimpleApp()
dialog = wx.DirDialog(None, "Choose a directory:",
style=wx.DD_DEFAULT_STYLE | wx.DD_DIR_MUST_EXIST)
if dialog.ShowModal() == wx.ID_OK:
print dialog.GetPath()
dialog.Destroy()
When I run it from cygwin using Python for Windows (Python 2.5.2), I get the following resizable DirDialog:
However, when I compile the above script with GUI2Exe, I get the this non-resizable DirDialog:
Googling showed me that there used to be a bug in resizing.
Do any of you have the correct code to create resizable DirDialog (without new dir button) ?
BTW, the same occurs if I use the following code:
import wx
if __name__ == "__main__":
app = wx.PySimpleApp()
dialog = wx.DirDialog(None, "Choose a directory:",
style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.DD_DIR_MUST_EXIST)
if dialog.ShowModal() == wx.ID_OK:
print dialog.GetPath()
dialog.Destroy()
or
import wx
if __name__ == "__main__":
app = wx.PySimpleApp()
dialog = wx.DirDialog(None, "Choose a directory:",
style=wx.RESIZE_BORDER | wx.DD_DIR_MUST_EXIST)
if dialog.ShowModal() == wx.ID_OK:
print dialog.GetPath()
dialog.Destroy()
Thanks and bye,
Ron.
P.S.: this is the GUI2Exe I use
I tried your code and have the same issue. It works fine in code but not in compiled form. I tried changing the "bundle" option to 3 since that's worked for other issues, but that had no effect in this case. I also tried it in the new GUI2Exe 0.2 and with py2exe 0.6.8, but that didn't help either. Finally, I tried it with the following styles: wx.DEFAULT_DIALOG_STYLE| wx.RESIZE_BORDER| wx.DD_DIR_MUST_EXIST
Looks like something goofy is going on here, but we'll have to wait for a guru.
app = wx.PySimpleApp()
dialog = wx.DirDialog(None, "Choose a directory:",
style=wx.RESIZE_BORDER | wx.DD_DIR_MUST_EXIST)
if dialog.ShowModal() == wx.ID_OK:
print dialog.GetPath()
dialog.Destroy()
Thanks and bye,
Ron.
P.S.: this is the GUI2Exe I use
I tried your code and have the same issue. It works fine in code but not in compiled form. I tried changing the “bundle” option to 3 since that’s worked for other issues, but that had no effect in this case. I also tried it in the new GUI2Exe 0.2 and with py2exe 0.6.8, but that didn’t help either. Finally, I tried it with the following styles: wx.DEFAULT_DIALOG_STYLE| wx.RESIZE_BORDER| wx.DD_DIR_MUST_EXIST
Looks like something goofy is going on here, but we’ll have to wait for a guru.
Sounds potentially like a manifest issue. Did you choose to include the Manifest in the py2exe (Gui2Exe) options?
That worked for me. I normally do that, but didn't in this case since the OP didn't mention doing anything special for his app. Anyway, I think it's always a good idea to include that on Windows.
Mike
···
On Mon, Nov 3, 2008 at 10:25 AM, Mike Driscoll <mike@pythonlibrary.org > <mailto:mike@pythonlibrary.org>> wrote:
Barak, Ron wrote:
Hi Guys,
I have a strange problem (on wx-2.8-msw-unicode).
I want to create a DirDialog that will be resizable and will
not allow me to create a new directory.
I tried the following:
import wx
if __name__ == "__main__":
app = wx.PySimpleApp()
dialog = wx.DirDialog(None, "Choose a directory:",
style=wx.DD_DEFAULT_STYLE | wx.DD_DIR_MUST_EXIST)
if dialog.ShowModal() == wx.ID_OK:
print dialog.GetPath()
dialog.Destroy()
When I run it from cygwin using Python for Windows (Python
2.5.2), I get the following resizable DirDialog:
However, when I compile the above script with GUI2Exe, I get
the this non-resizable DirDialog:
Googling showed me that there used to be a bug in resizing.
Do any of you have the correct code to create resizable
DirDialog (without new dir button) ?
BTW, the same occurs if I use the following code:
import wx
if __name__ == "__main__":
app = wx.PySimpleApp()
dialog = wx.DirDialog(None, "Choose a directory:",
style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER |
wx.DD_DIR_MUST_EXIST)
if dialog.ShowModal() == wx.ID_OK:
print dialog.GetPath()
dialog.Destroy()
or
import wx
if __name__ == "__main__":
app = wx.PySimpleApp()
dialog = wx.DirDialog(None, "Choose a directory:",
style=wx.RESIZE_BORDER | wx.DD_DIR_MUST_EXIST)
if dialog.ShowModal() == wx.ID_OK:
print dialog.GetPath()
dialog.Destroy()
Thanks and bye,
Ron.
P.S.: this is the GUI2Exe I use
I tried your code and have the same issue. It works fine in code
but not in compiled form. I tried changing the "bundle" option to
3 since that's worked for other issues, but that had no effect in
this case. I also tried it in the new GUI2Exe 0.2 and with py2exe
0.6.8, but that didn't help either. Finally, I tried it with the
following styles: wx.DEFAULT_DIALOG_STYLE| wx.RESIZE_BORDER|
wx.DD_DIR_MUST_EXIST
Looks like something goofy is going on here, but we'll have to
wait for a guru.
On Mon, Nov 3, 2008 at 4:55 PM, Cody Precord wrote:
Hello,
Sounds potentially like a manifest issue. Did you choose to include the
Manifest in the py2exe (Gui2Exe) options?
It does look like something manifest-related. I guess I should put the
manifest file option "on" by default if the user chooses to build an
executable based on a GUI app.
I want to create a DirDialog that will be resizable and will not allow me to create a new directory.
I tried the following:
import wx
if name == “main”:
app = wx.PySimpleApp()
dialog = wx.DirDialog(None, “Choose a directory:”,
style=wx.DD_DEFAULT_STYLE | wx.DD_DIR_MUST_EXIST)
if dialog.ShowModal() == wx.ID_OK:
print dialog.GetPath()
dialog.Destroy()
When I run it from cygwin using Python for Windows (Python 2.5.2), I get the following resizable DirDialog:
However, when I compile the above script with GUI2Exe, I get the this non-resizable DirDialog:
Googling showed me that there used to be a bug in resizing.
Do any of you have the correct code to create resizable DirDialog (without new dir button) ?
BTW, the same occurs if I use the following code:
import wx
if name == “main”:
app = wx.PySimpleApp()
dialog = wx.DirDialog(None, “Choose a directory:”,
style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.DD_DIR_MUST_EXIST)
if dialog.ShowModal() == wx.ID_OK:
print dialog.GetPath()
dialog.Destroy()
or
import wx
if name == “main”:
app = wx.PySimpleApp()
dialog = wx.DirDialog(None, “Choose a directory:”,
style=wx.RESIZE_BORDER | wx.DD_DIR_MUST_EXIST)
if dialog.ShowModal() == wx.ID_OK:
print dialog.GetPath()
dialog.Destroy()
Thanks and bye,
Ron.
P.S.: this is the GUI2Exe I use
I tried your code and have the same issue. It works fine in code but not in compiled form. I tried changing the "bundle" option to 3 since that's worked for other issues, but that had no effect in this case. I also tried it in the new GUI2Exe 0.2 and with py2exe 0.6.8, but that didn't help either. Finally, I tried it with the following styles: wx.DEFAULT_DIALOG_STYLE| wx.RESIZE_BORDER| wx.DD_DIR_MUST_EXIST
Looks like something goofy is going on here, but we'll have to wait for a guru.