This is more of a python question than a pygtk question, but I've been
unable to sort it out with my python books and several google
searches.

I have created a notebook than creates two tabs to display the
contents of two different directory structures (installed packages and
packages available for install).  Each tab is identical except for the
need to bind to different methods to handle the different directory
structure for each.

Right now I have the code duplicated to create each tab, and all is
cool, but it would be nice to be able to collapse the duplicated code
into a common function that I can invoke with the actual connection
functions passed in.

Is there a way to code a python function that receives an object that
can be invoked in that function,  i.e. the equivalent of passing in a
pointer to funtion in C code and invoking that function or passing its
address to another function.

Something like the following code snippet.

def callback(widget,entry) :
  pass

def function(rtn1) :
  . . .
  b2 = GtkRadioButton(label="Full list")
  b2.connect("pressed", rtn1, b2)
  ...

...
function(callback)
...



-- 
Collins Richey - Denver Area - WWTLRD?
gentoo(since 01/01/01) 2.4.18+(ext3) xfce-sylpheed-mozilla
_______________________________________________
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