# HG changeset patch # User Drew Perttula # Date 1370735853 0 # Node ID 1b19038f42e29b7489f5aaeee7c5aa6ac0dd2807 # Parent 95e311bffbd973b80759c3012798fa8dc38f5398 tricky fix for curvecalc not displaying subterms at launch Ignore-this: 1c68e9968c3ee0a5ad0fa3fbd6ccca73 diff -r 95e311bffbd9 -r 1b19038f42e2 bin/curvecalc --- a/bin/curvecalc Sat Jun 08 22:55:03 2013 +0000 +++ b/bin/curvecalc Sat Jun 08 23:57:33 2013 +0000 @@ -83,7 +83,8 @@ ec.show() wtree.get_object("subterms").connect("add", self.onSubtermChildAdded) - graph.addHandler(self.set_subterms_from_graph) + + self.refreshCurveView() self.makeStatusLines(wtree.get_object("status")) @@ -146,7 +147,14 @@ if dialog.run() == 1: self.curveset.new_curve(entry.get_text()) dialog.hide() - + + def onSubtermsMap(self, *args): + # if this was called too soon, like in __init__, the gtktable + # would get its children but it wouldn't lay anything out that + # I can see, and I'm not sure why. Waiting for map event is + # just a wild guess. + self.graph.addHandler(self.set_subterms_from_graph) + def onNewSubterm(self, *args): dialog = self.wtree.get_object("newSubterm") # the plan is to autocomplete this on existing subterm names @@ -189,17 +197,19 @@ for st in set(self.graph.objects(song, L9['subterm'])): log.info("song %s has subterm %s", song, st) - #term = Subterm(self.graph, st, self.songSubtermsContext()) - #add_one_subterm(term, self.curveset, master) + term = Subterm(self.graph, st, self.songSubtermsContext()) + add_one_subterm(term, self.curveset, master) master.show_all() - + log.info("%s table children showing" % len(master.get_children())) + def refreshTheme(self): gtk.rc_reparse_all() reactor.callLater(1, self.refreshTheme) def onSubtermChildAdded(self, subtermsTable, *args): # this would probably work, but isn't getting called + log.info("onSubtermChildAdded") v = subtermsTable.get_parent().props.vadjustment v.props.value = v.props.upper diff -r 95e311bffbd9 -r 1b19038f42e2 light9/curvecalc/curvecalc.glade --- a/light9/curvecalc/curvecalc.glade Sat Jun 08 22:55:03 2013 +0000 +++ b/light9/curvecalc/curvecalc.glade Sat Jun 08 23:57:33 2013 +0000 @@ -511,8 +511,9 @@ True False 2 + + -