With  pygtk-0.6.2 the following script  freezes  pygtk (sorry for my
english)
(python 1.5.2, gtk+-1.2.3-6mdk , gtk+-devel-1.2.3-6mdk,  Mandrake-Linux)

Suggestions?  (threads)
______________________________________________________________

#!/usr/bin/env python

#  Problem with input_add and GtkExtra
#  this script works if i add #undef WITH_THREAD in gtkmodule.c

import os
from gtk import *
import GtkExtra
inputf=0

def hello(*args):
 global inputf
 print "Hello World"
 fp = os.popen('cat /etc/fstab','r')
 inputf=input_add(fp,GDK.INPUT_READ,input_funct1)


def destroy(*args):
 window.hide()
 mainquit()

def input_funct1(fp,condition):
        global inputf
 lut = fp.readline()
 fp.close
        input_remove(inputf)
        message(['Message',"Message Hello"])

def message(message):
        GtkExtra.message_box(message[0],message[1],("Cancel",))


window = new(GtkWindow, type=WINDOW_TOPLEVEL, title='Hello World',
      allow_grow=FALSE, allow_shrink=FALSE, border_width=10)
window.connect("destroy", destroy)

print ""
button = new(GtkButton, label="Hello World", parent=window,
visible=TRUE)
button.connect("clicked", hello)

window.show_all()
mainloop()

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to