Ok, this is entirely weird. I have code that does:
#ifdef TEST_SAVE object g = PGallery.Gallery(); g->add_directory("/home/neotron/gallery/src/xmas2001"); g->add_directory("/home/neotron/gallery/src/mixed2002"); Stdio.write_file("gallery.pgs", encode_value(g, master()->Codec())); #else object g = decode_value(Stdio.read_file("gallery.pgs"), master()->Codec()); #endif
Now, if the first code set is run, I get the order I mentioned in the original post. However if the second piece of code is run, the order is the one I originally coded for, i.e:
Gallery()->f_gallery_tree_select_row(GTK.GladeXML,GTK.Ctree,GTK.CTreeNode,-1)
What on earth might this be? In both cases this method is called during either create() or in _decode_value of Gallery:
void show() { gl = GTK.GladeXML(); gl->new("pgallery.glade", "w_gallery"); gl->signal_autoconnect(signals(), gl); }
Why oh why does signal_autoconnect give me random callback methods?! Hmm.
Ah! I thin I know why - there's a new flag that changes the order. This flag is not initialized in the glade auto connect method. Doh!
/ David Hedbor
Previous text:
2003-01-10 10:32: Subject: Signal callbacks - wtf?!
Ok, so here's a weird one. I have a "unselected" callback for a CTree. I first wrote it in the main class and this was correct:
void f_gallery_tree_unselect_row(GTK.GladeXML gl_gallery, GTK.Ctree tree, GTK.CTreeNode node) { ... }
Then I moved it to a subclass and all of a sudden, I get this:
Attempt to call the NULL-value Unknown program: 0("w_gallery_title") PGallery.pmod/Gallery.pike:79: Gallery()->f_gallery_tree_unselect_row(GTK.CTreeNode,0,GTK.Ctree,GTK.Glade XML)
Note the order on the arguments! They are different (order)?! What is up with this? Both times I used code like this:
gl = GTK.GladeXML(); gl->new("pgallery.glade", "w_gallery"); gl->signal_autoconnect(signals(), gl);
signals() return a mapping of callback method names and their pointers.
So. Why does the order change?
/ David Hedbor