It's ok I just changed the behaivour of the script. One should not close the 
dialog on an apply signal but rather on a close signal that is emited on the 
last page (page must be of type gtk.ASSISTANT_PAGE_SUMMARY).

The last page has a close button that emits a close signal, one can handle that 
signal to destroy the assistant properly.

Y.Chaouche

--- On Wed, 8/18/10, chaouche yacine <yacinechaou...@yahoo.com> wrote:

> From: chaouche yacine <yacinechaou...@yahoo.com>
> Subject: [pygtk] Segmentation Fault on Assistant.destroy()
> To: pygtk@daa.com.au
> Date: Wednesday, August 18, 2010, 7:55 AM
> Hello list,
> 
> I want to close my Assistant at the last step, but I get
> Segmentation Faults all the time. Can someone look at this
> simplified example ?
> 
> 
> <code>
> import gtk
> 
> class SomePage(gtk.VBox):
>     def __init__(self,assistant):
>         gtk.VBox.__init__(self)
>         self.assistant = assistant
> 
>     def configure(self):
>         self.pack_start(gtk.Label("This
> is first page"))
>        
> self.assistant.set_page_title(self,"Let's go moin pote")
>        
> self.assistant.set_page_complete(self,True)
>        
> self.assistant.set_page_type(self,gtk.ASSISTANT_PAGE_CONFIRM)
> 
> class MainWindow(gtk.Assistant):
>     def __init__(self):
>         gtk.Assistant.__init__(self)
>         page = SomePage(self)
>         self.add_page(page)
>         self.connect_signals()
>         self.show_all()
> 
>     def add_page(self,page):
>         self.append_page(page)
>         page.configure()
> 
>     def connect_signals(self):
>        
> self.connect("apply",self.on_button_click)   
>     
> 
>     def on_button_click(self,widget):
>         self.destroy()
>     
> w = MainWindow()
> gtk.main()
> </code>
> 
> 
>       
> _______________________________________________
> pygtk mailing list   py...@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
> 


      
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to