How to correctly create resizable DirDialog (without "new directory" bottun) ?

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:

Outlook.jpg

However, when I compile the above script with GUI2Exe, I get the this non-resizable DirDialog:

Outlook.jpg

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
Outlook.jpg

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.

Mike

Hello,

Sounds potentially like a manifest issue. Did you choose to include the Manifest in the py2exe (Gui2Exe) options?

···

On Mon, Nov 3, 2008 at 10:25 AM, Mike Driscoll 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.

Mike


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Cody Precord wrote:

Hello,

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.

    Mike
    _______________________________________________
    wxpython-users mailing list
    wxpython-users@lists.wxwidgets.org
    <mailto:wxpython-users@lists.wxwidgets.org>
    http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

------------------------------------------------------------------------

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi All,

···

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.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Hi Cody,

You’ve hit the nail on the head:

once I checked the “XP Manifest File”, the behaviour of the compiled Windows exe file and the python script are identical (and correct :-).

Thank you,

Ron.

···

From: Cody Precord [mailto:codyprecord@gmail.com]
Sent: Monday, November 03, 2008 18:56
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] How to correctly create resizable DirDialog (without “new directory” bottun) ?

Hello,

Sounds potentially like a manifest issue. Did you choose to include the Manifest in the py2exe (Gui2Exe) options?

On Mon, Nov 3, 2008 at 10:25 AM, Mike Driscoll 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.

Mike


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users