synaptic-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Synaptic-devel] gtk_object_set_data(GTK_OBJECT(_win), "me", this);


From: Michael Vogt
Subject: Re: [Synaptic-devel] gtk_object_set_data(GTK_OBJECT(_win), "me", this);
Date: Mon, 20 Oct 2003 12:43:19 +0200
User-agent: Mutt/1.5.4i

Hi Dave,

On Mon, Oct 20, 2003 at 01:14:58AM -0500, david farning wrote:
> I am working on a port of synaptic to python as a front end to yum.

This is interessting! I like python a lot, can't wait for a first
(test)version :) 

If you want to support both apt and yum (that would be great), you may
want to make use of the work of Panu at:
http://koti.welho.com/pmatilai/apt-python/aptlib.py

He wrote a library that is based on the common/ subdir of synaptic and
gives high-level access to libapt.

You probably make use of the python-libglade library to reuse the
interface? 

> I can not figure out the significance of
> 
> gtk_object_set_data(GTK_OBJECT(_win), "me", this);
> 
> what is the point of associating "me" to this?

I think this particular line is cruft. But there are a few other place
where we make use of this technice. A standard gtk callback looks like
this: 
actionClicked(GtkWidget *self, void *data)

We get the widget that caused the action and we can pass data
around. If we need to pass data around and let the (static) function
know where to find the RGMainWindow class, we oftern use
g_object_set_data() and set "me" to the RGMainWindow class. This way,
we can use "data" to pass other information. 
 
I hope this helps. Feel free to ask if you have any other questions or
send suggestions to improve the code :)

bye,
 Michael




reply via email to

[Prev in Thread] Current Thread [Next in Thread]