# HG changeset patch # User Drew Perttula # Date 2013-06-08 23:57:33 # Node ID 1b19038f42e29b7489f5aaeee7c5aa6ac0dd2807 # Parent 95e311bffbd973b80759c3012798fa8dc38f5398 tricky fix for curvecalc not displaying subterms at launch Ignore-this: 1c68e9968c3ee0a5ad0fa3fbd6ccca73 diff --git a/bin/curvecalc b/bin/curvecalc --- a/bin/curvecalc +++ b/bin/curvecalc @@ -83,7 +83,8 @@ class Main(object): 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 @@ class Main(object): 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 @@ class Main(object): 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 --git a/light9/curvecalc/curvecalc.glade b/light9/curvecalc/curvecalc.glade --- a/light9/curvecalc/curvecalc.glade +++ b/light9/curvecalc/curvecalc.glade @@ -511,8 +511,9 @@ True False 2 + + -