a selected patch list at the bottom + handling of clicking on patches in rhs

This commit is contained in:
Jon Dowland 2008-01-29 23:40:35 +00:00
parent d39e8b00ba
commit 554baa539c
2 changed files with 34 additions and 3 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.4.1 on Tue Jan 29 22:49:25 2008 --> <!--Generated with glade3 3.4.1 on Tue Jan 29 23:34:52 2008 -->
<glade-interface> <glade-interface>
<widget class="GtkWindow" id="window1"> <widget class="GtkWindow" id="window1">
<property name="visible">True</property> <property name="visible">True</property>
@ -246,7 +246,24 @@
</packing> </packing>
</child> </child>
<child> <child>
<placeholder/> <widget class="GtkScrolledWindow" id="scrolledwindow3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<child>
<widget class="GtkTreeView" id="selected_patches">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="headers_clickable">True</property>
</widget>
</child>
</widget>
<packing>
<property name="position">4</property>
</packing>
</child> </child>
</widget> </widget>
</child> </child>

View file

@ -44,8 +44,12 @@ class HellowWorldGTK:
def rhs_callback(self, rhs): def rhs_callback(self, rhs):
offs,col = rhs.get_cursor() offs,col = rhs.get_cursor()
row = rhs.get_model()[offs[0]][0] model = rhs.get_model()
row = model[offs[0]][0]
selected_patches = self.wTree.get_widget("selected_patches")
model.append(None, [ row ])
print row print row
print type(model)
def set_texture(self, name): def set_texture(self, name):
# parse the example texture, fetch the width,height; # parse the example texture, fetch the width,height;
@ -106,6 +110,16 @@ class HellowWorldGTK:
column.add_attribute(cell, "text", 0) column.add_attribute(cell, "text", 0)
lhs.connect("cursor-changed", self.lhs_callback) lhs.connect("cursor-changed", self.lhs_callback)
# prepare the patch list
patch_list = self.wTree.get_widget("selected_patches")
treestore = gtk.TreeStore(str)
column = gtk.TreeViewColumn('Patch name')
patch_list.set_model(treestore)
patch_list.append_column(column)
cell = gtk.CellRendererText()
column.pack_start(cell, False)
column.add_attribute(cell, "text", 0)
# populate the RHS list with patch names # populate the RHS list with patch names
# yes, I learnt perl once. # yes, I learnt perl once.
patches = {} patches = {}