Close/hide a child window

2007-06-29 Thread Cubells
Hi there:

I have two simple classes in two diferent files:

$ cat first.py

#/usr/bin/env python
# -*- coding: utf-8 -*-

import pygtk
pygtk.require('2.0')
import gtk

import second

class first:

def close_program(self, widget, data=None):
gtk.main_quit()
return False
def open_second(self, widget):
second_window = eval("second.second")(self)

def __init__(self):
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.connect("delete_event", self.close_program)
window.set_title("First")
window.set_border_width(10)
button = gtk.Button("Open")
button.connect("clicked", self.open_second)
window.add(button)
window.show_all()

def main():
gtk.main()
return 0

if __name__ == "__main__":
first()   
main()


That's the second one:

$ cat second.py

#/usr/bin/env python
# -*- coding: utf-8 -*-

import pygtk
pygtk.require('2.0')
import gtk

class second(gtk.Window):

def close_second(self,widget):
self.hide()
#self.destroy()
#gtk.main_quit()
return False

def __init__(self, parent=None):
gtk.Window.__init__(self)
try:
self.set_screen(parent.get_screen())
except:
self.connect("destroy", lambda *w: gtk.main_quit())
window2 = gtk.Window(gtk.WINDOW_TOPLEVEL)
window2.set_title("Second")
window2.set_border_width(10)
window2.set_modal(True)
window2.set_resizable(False)
button2 = gtk.Button("Second")
button2.connect("clicked", self.close_second)
window2.add(button2)
window2.show_all()

def main():
gtk.main()
return 0

if __name__ == "__main__":
second()   
main()

The question is simple:

How can I close/hide/destroy the second window without to destroy the 
first window when I click the button2??
When I close the second window it works, but when I click the button2 it 
doesn't.

A lot of thanks...


-- 
http://mail.python.org/mailman/listinfo/python-list


MDaemon Warning - virus found: Error

2005-01-03 Thread l . cubells

*** WARNING **
Este mensaje ha sido analizado por MDaemon AntiVirus y ha encontrado 
un fichero anexo(s) infectado(s).  Por favor revise el reporte de abajo.

AttachmentVirus name   Action taken
--
file.zip  I-Worm.Mydoom.m  Removed


**


This message was not delivered due to the following reason(s):

Your message was not delivered because the destination server was
not reachable within the allowed queue period. The amount of time
a message is queued before it is returned depends on local configura-
tion parameters.

Most likely there is a network problem that prevented delivery, but
it is also possible that the computer is turned off, or does not
have a mail system running right now.

Your message could not be delivered within 2 days:
Host 7.131.94.177 is not responding.

The following recipients did not receive this message:


Please reply to [EMAIL PROTECTED]
if you feel this message to be in error.

-- 
http://mail.python.org/mailman/listinfo/python-list