Menu

#45 pyGOject crash when i move mainWindow or other window

1.0
open
nobody
None
2016-05-31
2016-05-27
thor33400
No

Hello, I have a big problem after a migration from pygtk2 to pyGObject.
I use the window installation of pyObject ( pygi-aio-3.14.0_rev22-setup.exe ) with python 2.7 32 bits.
My program works great as long as I don't move a window .
Please help me, of course I test different version of pygi but with the same problem.
I think it's a Vc++ problem but I have VCForPython27 installed.

Discussion

  • tumagonx

    tumagonx - 2016-05-27

    Hi,
    Sorry but this is insufficient information to move on, please provide reproducible snippet code that I can check on.

     
  • thor33400

    thor33400 - 2016-05-30
    I have tested with a basic program which open a window.
    When I move this window my program crash.
    

    ~~~

    def main(conf_path):
    Gdk.threads_init()
    mainWindow = Window()
    mainWindow.show_all()
    Gtk.main()

    if name == "main":
    conf_path = None
    for arg in sys.argv:
    arg = arg.lower()
    if arg.startswith('--config-path='):
    conf_path = arg[14:]
    continue

    main(conf_path)
    pid = os.getpid()
    if os.name == 'posix':
        os.kill(pid, signal.SIGQUIT)
    else :
        os.kill(pid, signal.SIGTERM)
    

    ~~~

     
  • tumagonx

    tumagonx - 2016-05-31

    Sorry could you attach one functional file? I don't think a simple window should crash like that.

    OTOH does this https://git.gnome.org/browse/pygobject/tree/demos/gtk-demo works on your computer?

     
  • thor33400

    thor33400 - 2016-05-31

    Thank you for your help, I find the solution. With GTK version > 3.6,
    Gdk.threads_init(), Gdk.threads_enter(), Gdk.threads_leave() should be replace by GLib.idle_add(priority, function, *data) for thread safe.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.