some more work on the movehistory window
authorArun Persaud <arun@nubati.net>
Sun, 4 Oct 2009 05:56:38 +0000 (22:56 -0700)
committerArun Persaud <arun@nubati.net>
Sun, 4 Oct 2009 05:56:38 +0000 (22:56 -0700)
added a scrollbar and fixed display of first move

gtk-interface.xml
xhistory.c

index 8805dc3..ab24899 100644 (file)
         <property name="orientation">vertical</property>
         <property name="spacing">2</property>
         <child>
-          <object class="GtkTreeView" id="MoveHistoryView">
+          <object class="GtkScrolledWindow" id="scrolledwindow1">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
-            <property name="model">MoveHistoryStore</property>
-            <property name="headers_clickable">False</property>
-            <property name="enable_search">False</property>
-            <property name="search_column">0</property>
+            <property name="hscrollbar_policy">automatic</property>
+            <property name="vscrollbar_policy">automatic</property>
             <child>
-              <object class="GtkTreeViewColumn" id="Move">
-                <property name="title">Move</property>
+              <object class="GtkTreeView" id="MoveHistoryView">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="model">MoveHistoryStore</property>
+                <property name="headers_clickable">False</property>
+                <property name="enable_search">False</property>
+                <property name="search_column">0</property>
                 <child>
-                  <object class="GtkCellRendererText" id="cellrenderertext1"/>
-                  <attributes>
-                    <attribute name="text">0</attribute>
-                  </attributes>
+                  <object class="GtkTreeViewColumn" id="Move">
+                    <property name="title">Move</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="MoveNumberRenderer"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
                 </child>
-              </object>
-            </child>
-            <child>
-              <object class="GtkTreeViewColumn" id="White">
-                <property name="title">White</property>
                 <child>
-                  <object class="GtkCellRendererText" id="cellrenderertext2"/>
-                  <attributes>
-                    <attribute name="text">1</attribute>
-                  </attributes>
+                  <object class="GtkTreeViewColumn" id="White">
+                    <property name="title">White</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="MoveWhiteRenderer"/>
+                      <attributes>
+                        <attribute name="text">1</attribute>
+                      </attributes>
+                    </child>
+                  </object>
                 </child>
-              </object>
-            </child>
-            <child>
-              <object class="GtkTreeViewColumn" id="Black">
-                <property name="title">Black</property>
                 <child>
-                  <object class="GtkCellRendererText" id="cellrenderertext3"/>
-                  <attributes>
-                    <attribute name="text">2</attribute>
-                  </attributes>
+                  <object class="GtkTreeViewColumn" id="Black">
+                    <property name="title">Black</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="MoveBlackRenderer"/>
+                      <attributes>
+                        <attribute name="text">2</attribute>
+                      </attributes>
+                    </child>
+                  </object>
                 </child>
               </object>
             </child>
index a08dcc8..ee865fd 100644 (file)
@@ -131,6 +131,9 @@ void HistorySet(char movelist[][2*MOVE_LEN],int first,int last,int current)
   char movewhite[2*MOVE_LEN],moveblack[2*MOVE_LEN],move[2*MOVE_LEN];
   GtkTreeIter iter;
 
+  /* first clear everything, do we need this? */
+  gtk_list_store_clear(LIST_MoveHistory);
+
   /* copy move list into history window */
 
   /* go through all moves */