Re: PYGTK: How can one add an argument to a callback?
- From: finlay moeraki com
- To: "Daniel B. Thurman" <dant cdkkt com>
- Cc: GTK Applications <gtk-app-devel-list gnome org>
- Subject: Re: PYGTK: How can one add an argument to a callback?
- Date: Tue, 3 Nov 2009 19:00:27 -0800
The following code:
[...]
tvc.set_cell_data_func(cp, self.on_file_pixbuf)
[...]
def on_file_pixbuf1(self, column, cell, model, iter):
<code>
[...]
works fine, but what if I need to add another
argument to "self.on_file_pixbuf" without destroying
the arguments already supplied by the constructor?
For example, I want to do the following:
tvc.set_cell_data_func(cp, self.on_file_pixbuf1(t))
where 't' is another argument I wish to pass in
addition to that provided by the cell so that the
method results as:
def on_file_pixbuf1(self, column, cell, model, iter, t):
<code>
Make the call like:
tvc.set_cell_data_func(cp, self.on_file_pixbuf, t)
for callback like:
def on_file_pixbuf1(self, column, cell, model, iter, t):
John
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]