-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Answer from Christian Reis
> 
> Plain "connect" works fine, but the "connect_after"
> callback does not get called.
> Or am I doing something wrong? See attached example.

There might be a default handler that is returning TRUE somewhere that is running 
after your connect()ed handler, but I'm not sure. A simple code snippet would have 
perhaps been easier to grasp, though :-)

Answer from James:      
Stephen Kennedy wrote:

>Plain "connect" works fine, but the "connect_after"
>callback does not get called.
>Or am I doing something wrong? See attached example.
>  
>
No bug here.

For the standard widget event signals, a custom accumulator is set.  
When going through the list of handlers to call for the signal, the 
process goes like this:

   1. call handler
   2. if it returned True, skip the rest of the handlers in the list and
      return True
   3. otherwise, continue to the next handler

GtkTreeView handles button press events, so its handler will return 
True.  If you have a handler further down the list, then it won't get 
called.

- ------- reply

So far so good. But I have the same problem with the good old Clist. There is the same 
situation.

- --- snippet - connect

                self.user_printers_clist.connect('select-row',     self.onRowSelected)
                self.user_printers_clist.connect('unselect-row',   self.onRowSelected)
                self.user_printers_clist.connect_after('button_press_event', 
self.onRowBtn2Clicked)

- --- snippet - methods

        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 there is a double click, call the dialog via signal-propagation
                if ev.button == 1 and ev.type == 5:
                        self.set_options_button.clicked()
                return FALSE

        def onRowSelected(self, clist, row, *args):
                ''' aktiviere und deaktiviere die aktionskn�pfe '''
                #print clist.selection, clist.get_data('user-item-data')
                if len(clist.selection) > 0:
                        _status = TRUE
                        _p = clist.get_row_data( clist.selection[0] )
                else:
                        _status = FALSE

                if clist.get_data('user-item-data') == 'system-to-user':
                        self.select_printer_button.set_sensitive( _status )

                elif clist.get_data('user-item-data') == 'user-to-system':
                        _val = _status
                        if _status and _p.name == 
self.default_printer_label.get_text():
                                _val = not _status
                        self.set_default_button.set_sensitive( _val )
                        self.deselect_printer_button.set_sensitive( _status )
                        self.set_options_button.set_sensitive( _status )
                return FALSE

- --- snippet end.
The difference to the 0.6.x code is, that I include the return statements in the 
functions with
FALSE. If I do a signal_connect I get a deadlock situation with the dialog window 
which is called via
Set_options_button.clicked().

Could it be a bug anyway ?

Enlightment is appreciated :-)

- --maik./

mit freundlichem Gru� /
with best regards

Maik Hertha
- --------------------------------------------
hartmann+hertha
it design

mhertha at hartmann-hertha.de
http://www.hartmann-hertha.de
- --------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)

iD8DBQE+euNwbd3QGXGos6ERAmrfAJ9RcZMgWPvpCS9t8Y4zEhD0ScuzqwCggZV1
MH/smiX8pYOGpmjANWqBzjk=
=cbWc
-----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/

Reply via email to