Results 1 to 7 of 7

Thread: python wxWidgets application problem

  1. #1
    Join Date
    Feb 2009
    Location
    Cymru (Wales)
    Beans
    58
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    python wxWidgets application problem

    I'm trying to run the text editor example application from:

    http://wiki.wxpython.org/Getting%20Started

    (Specifically the first example with a menu attached)

    Ubuntu 12.04, Python 2.7

    Having pasted the code into IDLE, saved the file and then run the application from within IDLE, the frame appears, but the menu does not. The application does not run at all outside of IDLE.

    Any suggestions greatly appreciated.

    Best regards


    PAE

  2. #2
    Join Date
    Feb 2009
    Location
    Cymru (Wales)
    Beans
    58
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: python wxWidgets application problem

    Well, I sorted two out of the three problems. Both were the results of my own stupidity.

    The menu doesn't show because it's the Unity interface and so the menu doesn't appear in the application window but rather at the top of the desktop. I really should have thought of that earlier but tiredness took its toll, I'm afraid.

    The application didn't run from the command line because I'd omitted the shebang line. Again, it must be tiredness that's to blame for that.

    But I still have the problem of not being able to re-run the application in IDLE. If anyone does know why that should be the case I'd be glad to hear it, but it sounds like an IDLE problem, so I'll look for an IDLE forum and post there.

    Many thanks


    PAE

  3. #3
    Join Date
    Feb 2009
    Location
    Cymru (Wales)
    Beans
    58
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: python wxWidgets application problem

    Continuing this conversation I'm having with myself - for which I apologise...

    The way the IDLE process is started is responsible for the fact that I can't run programs twice in the same shell in IDLE. Apparently the launcher starts IDLE using the -n option which has this undesirable side effect. Starting IDLE from the command line without the -n option fixes the problem, but is annoying.

    Does anyone know how to make the Unity launcher start IDLE 'properly' (i.e. without the -n option)?

    Cheers


    PAE

  4. #4
    Join Date
    May 2007
    Location
    Leeds, UK
    Beans
    1,664
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: python wxWidgets application problem

    You could edit the .desktop file. The usual way is to copy it from /usr/share/applications to ~/.local/share/applications and edit your local copy which takes precedence over the global one. Look for the Exec line. I'm assuming it would be idle.desktop.
    Please create new threads for new questions.
    Please wrap code in code tags using the '#' button or enter it in your post like this: [code]...[/code].

  5. #5
    Join Date
    Feb 2009
    Location
    Cymru (Wales)
    Beans
    58
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: python wxWidgets application problem

    Many thanks. Yep. That did it. Although, actually, I had achieved it in a roundabout way before getting your reply.

    Having failed to find out how to change the command in Unity, I started an LXDE session and did it there - where all you have to do is right-clickk on the menu item. Back in Unity, the change persisted, so job done. But your way would have been better, had I known about it.

    Pretty much all the main Linux desktops that are GNOME or KDE-based seem to be moving in the direction of making trivial changes like these hard to do, it appears to me. I think that's a mistake.

    Thanks for your help.

  6. #6
    Join Date
    May 2007
    Location
    Leeds, UK
    Beans
    1,664
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: python wxWidgets application problem

    I agree that it's probably harder than it should be. For reference, here are the docs that describe the process using the editor method and alacarte (which is what I suspect your LXDE session did):

    https://help.ubuntu.com/community/Un...ndDesktopFiles
    Please create new threads for new questions.
    Please wrap code in code tags using the '#' button or enter it in your post like this: [code]...[/code].

  7. #7
    Join Date
    Feb 2009
    Location
    Cymru (Wales)
    Beans
    58
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: python wxWidgets application problem

    Thanks. Much appreciated.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •