wxFileDialog error - dlg not defined

Help
active8
2004-09-01
2004-09-01
  • active8

    active8 - 2004-09-01

    That's what I get following the 2.6 help (tutorial) when I run the app

    dlg not defined

        def OnMnuFileItems1Menu(self, event):

    # Here's the code generated from the pallet

            dlg = wxFileDialog(self, "Choose a file", ".", "", "*.*", wxOPEN)
    try:
        if dlg.ShowModal() == wxID_OK:
            filename = dlg.GetPath()
            # Your code
    finally:
        dlg.Destroy()

    hmm... what's wrong?

    TIA
    Mike

     
    • Werner F. Bruhin

      Can't be sure, but would bet a lot, that you have your indentation wrong.

      Here on SourceForge this is difficult to see, have a lock at the message exchange I had with Chuck on gmane.comp.ide.boa-constructor.user .

      Python is sensitive, or I prefere to call it enforces, indention.  Your problem is that the lines from "try:" onwards are not on the correct indent level.  Have a look at the sample file in the above message exchange.

      See you
      Werner

       
    • active8

      active8 - 2004-09-01

      I did get indent errors and fixed as much as I could figure out - those erors stopped. If the pallet/wizard made an indent error for me, after following the instructions and putting the cursor where I was instructed (the tutorial says at the beginning of "skip"m but the code inserted was actually "event.Skip()") then theres still a boa prob or documentation prob..

      I couldn't find the aforementioned group at earthlink, individual.net, or google, so I can't see the discussion.

      Thanks

       
    • active8

      active8 - 2004-09-01

      OK, Herr Werner :) I just did the indents the way I would in C++ and it's ok.

      I'll annotate my notated notes ;) re that. Up to 8 lines, now. BTW, my intuitively placed indents match what the tutorial shows, its just that boa messes it up.

      Still can't find that group - even googled google groups for boa-constructor, as opposed to the whole group name.

      Boa is a real nice looking IDE. I hope it saves me from using wxGlade. It was kinda flakey last time I used it, but if I get a decent XRC resource for wxWidgets/C++ apps, I'll be happy - 'till I find out that XRCeD or boa does a better job.

      Python doesn't take XRC resources, does it?

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks