Re: Fw: Custom widget with GladeXML



On Wednesday, October 1, 2003, at 10:42 AM, Chas Owens wrote:

: So it sounds to me like a stack pointer mismanagement issue, but I
: can't find anything that looks out of place.
:

Should we be using GPerlCallback instead of mucking about with the stack ourselves? I am going to try adapting the code in GtkContainer.xs to what i think I need in GladeXML.xs and see how far I can get before someone stops me or
my brain explodes (offically 26 hours awake now).

it should absolutely be using GPerlCallback and/or GPerlClosure. from my initial once-over[1] it looks like it's using the old gtk-perl-style callbacks which accept a list for user data, but sometimes pushes all the elements onto the stack and sometimes pushes only one, and appears in most cases to leak the AV after all. it should be fixed to use the Glib module's utilities or at least its style, for consistency.

the global custom_args hack should not be necessary -- that's what the user_data argument and GPerlCallback are for.

now, it may be quite a trick figuring out how to trigger the proper destruction of the callback objects, since no destroy notifiers are included; possibly the callback should be placed into object data of the object to which it is connected (with g_object_set_data_full).


as for why POPs returns what was on the beginning of the stack before... i have no clue. the code looks right --- PUSHMARK, load the stack, commit the new stack with PUTBACK, call_sv, read the mangled stack with SPAGAIN, and POPs... that should read from the end. i don't get it.


[1] i admit, i've never looked at this code before. i have next to no idea what's going on with libglade, so i've never had occasion to touch it.

--
muppet <scott at asofyet dot org>




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