Added a Clonemaster namespace to the dll. Turns out there's a BackgroundImage property to control, so I still needed to disambiguate the damn thing...
Bugger, that seems to have broken something. Buttons aren't being disabled as they should, and the narrative index isn't being set.
Snippet is broken too, so it's not just a background image thing.
Hmm... I bet its another type name switch that broke with the namespace
Update:
That's exactly the problem. Fixed version (hopefully):
tv.AfterSelect += def(o,e as TreeViewEventArgs):
n = e.Node
print "node.index = ${e.Node.Index}"
ts = "${n.Tag.GetType()}"
if ts == "Clonemaster.Narrative":
NarrClick(n.Tag, n.Index)
if ts == "Clonemaster.Scene":
SceneClick(n.Tag)
if ts == "Clonemaster.Snippet":
SnipClick(n.Tag,n.Parent.Index, n.Index)
if ts == "Clonemaster.Thumb":
ThumbClick(n.Tag,n.Parent.Index, n.Index)
if ts == "Clonemaster.Choice":
ChoiceClick(n.Tag,n.Parent.Index, n.Index)
I don't know of a good OO way to get around this one. I suppose I could have wrapper func to raise the relevant event. Is it worth the trouble, I ask.
Let's see if I get any more problems from tjhis.
No comments:
Post a Comment