Changeset - 1b19038f42e2
[Not reviewed]
default
0 2 0
Drew Perttula - 12 years ago 2013-06-08 23:57:33
drewp@bigasterisk.com
tricky fix for curvecalc not displaying subterms at launch
Ignore-this: 1c68e9968c3ee0a5ad0fa3fbd6ccca73
2 files changed with 17 insertions and 6 deletions:
0 comments (0 inline, 0 general)
bin/curvecalc
Show inline comments
 
@@ -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
 

	
light9/curvecalc/curvecalc.glade
Show inline comments
 
@@ -511,8 +511,9 @@
 
                                <property name="visible">True</property>
 
                                <property name="can_focus">False</property>
 
                                <property name="n_columns">2</property>
 
                                <signal name="child-added" handler="onSubtermChildAdded" swapped="no"/>
 
                                <signal name="map" handler="onSubtermsMap" swapped="no"/>
 
                                <signal name="add" handler="onSubtermChildAdded" swapped="no"/>
 
                                <signal name="child-added" handler="onSubtermChildAdded" swapped="no"/>
 
                                <child>
 
                                  <placeholder/>
 
                                </child>
0 comments (0 inline, 0 general)