[Glade-devel] glade patch



This message is in MIME format.

---MOQ107229167960d890fb423e40c48b194aecd7674a5c
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit


I have a new function to add to libglade it basically just makes it
easier to use glade for things such as the following:

I define a struct that contains my application state.
then i normally using gtk would just pass this via
g_signal_connect to each callback.  using 
glade_xml_signal_autoconnect  I have no way of doing this.
I believe I can accomplish what I want using 
glade_xml_signal_autoconnect_full
however, this function requires quiet a bit of understanding more
then I the casual user cares to understand.  So, the solution to 
my problem was to add the following function:

glade_xml_signal_autoconnect_with_data (GladeXML *self, gpointer user_data);

which works just like glade_xml_signal_autoconnect just passes along
the user_data to the g_signal_connect functions.  

the patch provided is for what's currently in cvs.

hope this patch is useful

-todd

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/

---MOQ107229167960d890fb423e40c48b194aecd7674a5c
Content-Type: text/x-patch; name="data.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="data.diff"

PyBkYXRhLmRpZmYKSW5kZXg6IGdsYWRlL2dsYWRlLXhtbC5jCj09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6
IC9jdnMvZ25vbWUvbGliZ2xhZGUvZ2xhZGUvZ2xhZGUteG1sLmMsdgpyZXRyaWV2aW5nIHJldmlz
aW9uIDEuMTA0CmRpZmYgLXUgLXIxLjEwNCBnbGFkZS14bWwuYwotLS0gZ2xhZGUvZ2xhZGUteG1s
LmMJMjMgSnVsIDIwMDMgMTQ6NDg6NDggLTAwMDAJMS4xMDQKKysrIGdsYWRlL2dsYWRlLXhtbC5j
CTI0IERlYyAyMDAzIDE4OjQyOjA0IC0wMDAwCkBAIC0yNzEsMTUgKzI3MSwyMSBAQAogICAgIH0K
IH0KIAorLyogdXNlZCBmb3IgcGFzc2luZyBib3RoIHRoZSBtb2R1bGUgc3ltYm9scyBhbmQgdXNl
ciBkYXRhIHRvIGV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E0OjU1OjMxIC0wMDAwCTEuMzEKKysrIGds
YWRlL2dsYWRlLXhtbC5oCTI0IERlYyAyMDAzIDE4OjQyOjA0IC0wMDAwCkBAIC04MSw2ICs4MSwx
NSBAQAogICovCiB2b2lkICAgICAgIGdsYWRlX3htbF9zaWduYWxfYXV0b2Nvbm5lY3QgIChHbGFk
ZVhNTCAqc2VsZik7CiAKKy8qCisgKiBiYXNpY2FsbHkgdGhlIHNhbWUgYXMgZ2xhZGVfeG1sX3Np
Z25hbF9hdXRvY29ubmVjdCBidXQgcGFzc2VzCisgKiBhIHVzZXIgZGF0YSB2YXJpYWJsZSB3aGlj
aCBnZXRzIGNvbm5lY3RlZCB0byBlYWNoIHNpZ25hbCBoYW5kbGVyCisgKiB1c2VmdWwgaWYgeW91
J2QgbGlrZSB0byBtYWludGFpbiBhIHNpbmdsZSBzdHJ1Y3QgYWNjcm9zcyBhbGwgCisgKiBjYWxs
YmFjayBmdW50aW9ucy4KKyAqLwordm9pZCAgICAgICBnbGFkZV94bWxfc2lnbmFsX2F1dG9jb25u
ZWN0X3dpdGhfZGF0YSAoR2xhZGVYTUwgKnNlbGYsIAorICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3BvaW50ZXIgdXNlcl9kYXRhKTsKKwogLyogaWYg
dGhlIGd0a19zaWduYWxfY29ubmVjdF9vYmplY3QgYmVoYXZpb3VyIGlzIHJlcXVpcmVkLCBjb25u
ZWN0X29iamVjdAogICogd2lsbCBwb2ludCB0byB0aGUgb2JqZWN0LCBvdGhlcndpc2UgaXQgd2ls
bCBiZSBOVUxMLgogICovCg==

---MOQ107229167960d890fb423e40c48b194aecd7674a5c--




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