views:

48

answers:

2

Hello everybody!

I just managed to get py2exe work on a Windows Virtual Machine but stumbled on another problem which I didn't have right after I installed GTK, Pango, Gobject etc. on that machine: When I launch a Python Script the window appears but it immediately stops responding. This happens too if I open a python interpreter and type:

import gtk
w = gtk.Window()
w.show()

I'm not allowed to post any images yet, but here's the link to a screenshot: http://i.imgur.com/3RJ0n.png

This is a problem for me, as if I create an executable with py2exe I get the same result when I execute the program.

Thank you for your help and for your time spent to help me! :)

Solved! It seems installing ActivePython the installing GTK runtime, PyCairo, PyObject, PyGtk as administrator with compatibility mode for Windows Xp Service Pack 2 solved the problem. Thank you adw for your help and suggestions!

+2  A: 

You need to run a main loop so GTK can process events, draw in the window, etc.

Add this to your program:

gtk.main()

See also: http://live.gnome.org/PyGTK/QuickStart

adw
Don't worry I'm not a beginner, I've already added that to the end of the file. The problem doesn't come from there. What I showed above is in the python interpreter(you don't need to start a loop)
Calin
Does your normal development machine run Windows, Linux or something else; and does the program work properly there? Could you supply a minimal program that shows the problem?
adw
I run Linux and Windows is being ran in a Virtual Machine. Even a simple program like:import gtk;w = gtk.Window();w.show();gtk.main();gets this error. If the program is a PyGtk program it just stops responding right after it opened.I supplied an example of a program that doesn't work on this link http://pastebin.com/An6z5WtiNote: This isn't the only program that doesn't work, it's just an example. Any Gtk program stops responding(if I click it the End Now Dialog appears).Thank you for helping me!
Calin
I know the path to the Glade file is "/home/calin/..." but this is changed in the other programs so that's not why it doesn't work. May it be because of the first line(#!/usr/bin/env python)?
Calin
adw
if I don't use threads, my programs just go gray if they undergo some heavy processing. I don't know how to correctly use them but I will check that link out. The problem doesn't come from the threads, as any pygtk app freezes.
Calin
+1  A: 

Solved! It seems installing ActivePython the installing GTK runtime, PyCairo, PyObject, PyGtk as administrator with compatibility mode for Windows Xp Service Pack 2 solved the problem. Thank you adw for your help and suggestions!

Calin