-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > > > On Fri, Mar 28, 2003 at 08:29:45AM +0100, Maik Hertha wrote: > > > Really? Can't you just use connect() and return True > when a double > > > click is performed (event.type == gtk.gdk._2BUTTON_PRESS)? > > > > > Then I need a little assistance. The current situation is: > > - - the double-click propagates a button.clicked() signal > to raise a > > dialog-window > > - - the dialog-window pops up and is transient to the parent-window. > > Sounds pretty normal to me. So it's button_press_event and > then window.show(). > > > At this point I get a X-Server deadlock. This could only be solved > > Eh? This doesn't sound right. Isn't it just your app that hanged?
Yes, true. But the X-Server too (Mandrake9.0/XFree4.2/KDE3.0). > > > with ctrl-alt-backsp. I mention that if the click-signal of the > > button is triggered, the function never returns while the dialog is > > up. Yes, the dialog would create its own mainloop. In 1.2 > this problem > > was solved with a w.connect_after(). How to do in 2.0? I think > > starting an extra thread is a little bit beyond the goal. > > A connect_after() to do what? Show the dialog, start the new mainloop in dialogs-context, quit the dialog and return values. Update the mainwindow. - --- snippet class BaseDialog( gtk.Dialog ): ''' basisklasse für dialoge ''' def __init__(self, parent=None): gtk.Dialog.__init__( self ) self.connect('delete_event', self.quit) self.set_position( gtk.WIN_POS_CENTER ) # in der bildschirmmitte #gtk.grab_add(self) if parent: self.set_transient_for( parent ) # vor dem elternfenster self.set_modal( TRUE ) self.msg_area = gtk.VBox() self.vbox.pack_start( self.msg_area ) def quit(self, *args): ''' die abarbeitung ''' self.hide() self.destroy() gtk.mainquit() def run(self): ''' versetzt die funktion in die ablaufschleife ''' self.show_all() gtk.mainloop() # ende abwarten class SimpleDialog(BaseDialog): def __init__(self, parent=None): BaseDialog.__init__(self, parent) .... class PrinterOptionsDialog(SimpleDialog): ''' klasse für die definition der drucker optionen ''' def __init__(self, parent=None, printer=None): SimpleDialog.__init__(self, parent) .... Main_appwindow defines: self.set_options_button.connect('clicked', self.onSetOptionsClicked) self.user_printers_clist.connect('select-row', self.onRowSelected) self.user_printers_clist.connect('unselect-row', self.onRowSelected) #self.user_printers_clist.connect('button_press_event', self.onRowBtn2Clicked) <<< deadlocks the X-Server self.user_printers_clist.connect_after('button_press_event', self.onRowBtn2Clicked) def onRowBtn2Clicked(self, clist, ev): ''' verarbeitet doppelklicks auf die zeilen ''' print clist.selection, ev.button, ev.type if not clist.selection: return data = clist.get_row_data( clist.selection[0] ) if ev.button == 1 and ev.type == 5: self.set_options_button.clicked() <<< trigger the options dialog signal in the context return FALSE # of the current event_scope def onSetOptionsClicked(self, btn): ''' rufe den options dialog für den aktuell selektierten Drucker ''' _cl = self.user_printers_clist _pr = _cl.get_row_data( _cl.selection[0] ) #print 'onSetOptionsClicked: ', _pr.name dlg = PrinterOptionsDialog(self, _pr) newopts = dlg.run() <<<< dialog is shown, but kills the app if only w.connect(.. # if w.connect_after(.. It is done as expected. _pr.mf2def.options = newopts.split(',') #print 'onSetOptionsClicked: ', newopts, ' to ', _pr.mf2def.options self.setApplyActive() # änderungen übernehmen aktivieren - ---- snippet/. Hope it is clear enough. Thank you for your help. - --maik./ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (MingW32) iD4DBQE+hGbjbd3QGXGos6ERAmntAJdvZ8Z/KY912fL+G/PVKQRIge7VAJ9vTMSA B71r2FO56PVbZpfWPnpxAQ== =zicZ -----END PGP SIGNATURE----- _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/