Pmw.Balloon under Windows

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aki Niimura

    #1

    Pmw.Balloon under Windows

    Hello everyone,

    I'm encountering a weird problem and couldn't find any Internet
    postings
    that are relevant to my problem and it seems coming from the Pmw
    Balloon
    widget inside.

    I have developed a Tkinter software using Pmw.
    The software is being developed under Solaris but is targeting all
    platforms
    including Windows.

    The software is working fine under Solaris 9.
    However, when I tried it under Windows, it worked also fine but it spit
    out
    the following error message when exiting.

    (from cygwin terminal)

    % c:/Python23/python my_app.py

    This application has requested the Runtime to terminate it in an
    unusual way.
    Please contact the application's support team for more information.

    (the same error message is observed when I run the program directly in
    Windows XP environment.)
    //

    First, I thought I screwed up something because it was working fine
    before
    with my older software version.

    After painful investigation, I found Pmw.Balloon was causing this
    problem
    (because the problem went away if I commented out all balloon
    statements).

    Then I compared my usages and Pmw Balloon example because the example
    didn't
    cause this. (http://pmw.sourceforge.net/doc/Balloon.html)

    But I didn't see any problem in my coding.

    //

    Then I found two clues:
    (1) The problem won't occur if I quit the program by clicking 'X' of
    the Window decoration. (not from Quit in the Menu)

    (2) The Pmw Balloon example has the exact same problem *if*
    I change the program to quit using widget quit() method.

    self.suicide = Tkinter.Button( frame, text='Kill me soon!',
    command = parent.quit) # this causes the problem
    # command = self.killButton ) # The original one

    Of course, the problem is occurring only under Windows. (Windows
    XP/Cygwin)

    //

    My questions are:
    (1) Why my program is complaining and is there any workaround?

    (2) What is the difference between using widget quit() method
    and using Windows 'X' button.
    - I know clicking Windows 'X' button generates an event but I thought
    - ultimately it reached to the same routine to terminate the program.

    (3) Is it possible to fake clicking 'X' button?
    I see a widget has event_generate( ) method.

    //

    Any feedbacks, comments are highly appreciated.
    It would be nice if you can send your reply to <akineko@pacbel l.net> .

    Thank you for your attention.

    Best regards,
    Aki Niimura

  • Eric Brunel

    #2
    Re: Pmw.Balloon under Windows

    On 16 Feb 2005 10:51:27 -0800, Aki Niimura <akineko@pacbel l.net> wrote:
    [snip][color=blue]
    > The software is working fine under Solaris 9.
    > However, when I tried it under Windows, it worked also fine but it spit
    > out
    > the following error message when exiting.
    >
    > (from cygwin terminal)
    >
    > % c:/Python23/python my_app.py
    >
    > This application has requested the Runtime to terminate it in an
    > unusual way.
    > Please contact the application's support team for more information.
    >
    > (the same error message is observed when I run the program directly in
    > Windows XP environment.)
    > //[/color]
    [snip][color=blue]
    > After painful investigation, I found Pmw.Balloon was causing this
    > problem
    > (because the problem went away if I commented out all balloon
    > statements).
    >
    > Then I compared my usages and Pmw Balloon example because the example
    > didn't
    > cause this. (http://pmw.sourceforge.net/doc/Balloon.html)[/color]

    I used the Pmw.Balloon quite a lot and never see any problem.

    One question: what Python do you use? Is it a regular Windows Python distribution or the Python delivered with Cygwin? I know by experience that the Python in Cygwin has quite a lot of problems (mine crashes *very* often). If you don't already use a "regular" Windows distro, I think using one may solve your problem.
    [color=blue]
    > My questions are:
    > (1) Why my program is complaining and is there any workaround?
    >
    > (2) What is the difference between using widget quit() method
    > and using Windows 'X' button.
    > - I know clicking Windows 'X' button generates an event but I thought
    > - ultimately it reached to the same routine to terminate the program.[/color]

    I think the default binding for the 'X' button is to call destroy, not quit. Calling destroy on the main window is almost equivalent to calling quit, so maybe it can be a solution?
    [color=blue]
    > (3) Is it possible to fake clicking 'X' button?
    > I see a widget has event_generate( ) method.[/color]

    Not that I know of. The event_generate method won't help here, because the 'X' button is handled by the window manager, and not by the application. It's a bit more complicated on Windows (as usual...) since there is no "real" window manager, but from the tk/Tkinter point of view, the result is the same: you can't "fake" a window manager event using event_generate.


    BTW, what are the versions of Python, tk and Pmw you're using?

    HTH a little...
    - Eric Brunel -

    Comment

    • Aki Niimura

      #3
      Re: Pmw.Balloon under Windows


      Eric Brunel wrote:
      [color=blue]
      > One question: what Python do you use? Is it a regular Windows Python
      > distribution or the Python delivered with Cygwin? I know by[/color]
      experience[color=blue]
      > that the Python in Cygwin has quite a lot of problems (mine crashes[/color]
      *very*[color=blue]
      > often). If you don't already use a "regular" Windows distro, I think[/color]
      using[color=blue]
      > one may solve your problem.[/color]

      Yes, I noticed the difference. I'm using the Python 2.3.5 installed on
      Windows.
      (Pmw 1.2)
      [color=blue]
      > I think the default binding for the 'X' button is to call destroy,[/color]
      not quit.[color=blue]
      > Calling destroy on the main window is almost equivalent to calling[/color]
      quit, so[color=blue]
      > maybe it can be a solution?[/color]

      I have tried calling root.destroy() as you suggested. It worked.
      My application is now not generating the error message.
      Thank you for your suggestion.
      [color=blue]
      > Not that I know of. The event_generate method won't help here, ...[/color]

      Good to know that.

      I think Window is a different beast as it doesn't have a window
      manager.

      Thank you,
      Aki Niimura

      Comment

      Working...