fixed loading games. crashed because a X-func was called.
[xboard.git] / callback.c
index 1d10abe..eb9b4da 100644 (file)
@@ -14,6 +14,7 @@
 
 extern GtkWidget  *about;
 extern GtkWidget  *GUI_Window;
+extern GtkWidget  *GUI_Aspect;
 extern GtkWidget  *GUI_Menubar;
 extern GtkWidget  *GUI_Timer;
 extern GtkWidget  *GUI_Buttonbar;
@@ -60,12 +61,13 @@ ExposeProc(object, user_data)
       gtk_widget_size_request(GTK_WIDGET(GUI_Buttonbar),   &w);
       totalh += w.height;
       
-      ratio  = (totalh+boardHeight)/(boardWidth) ;
+      ratio  = ((float)totalh+boardHeight)/((float)boardWidth) ;
             
       gtk_widget_set_size_request(GTK_WIDGET(GUI_Board),
                                  boardWidth,boardHeight);
       
-      GUI_SetAspectRatio(ratio);
+      gtk_aspect_frame_set (GTK_ASPECT_FRAME(GUI_Aspect),0,0,ratio,TRUE);
+
       /* recreate pieces with new size... TODO: keep svg in memory and just recreate pixmap instead of reloading files */
       CreatePieces();
     } 
@@ -425,6 +427,30 @@ void RetractMoveProc(object, user_data)
 }
 
 /* Option Menu */
+void AutocommProc(object, user_data)
+     GtkObject *object;
+     gpointer user_data;
+{
+    appData.autoComment = !appData.autoComment;
+    return;
+}
+
+void AutoflagProc(object, user_data)
+     GtkObject *object;
+     gpointer user_data;
+{
+    appData.autoCallFlag = !appData.autoCallFlag;
+    return;
+}
+
+void AutoflipProc(object, user_data)
+     GtkObject *object;
+     gpointer user_data;
+{
+    appData.autoFlipView = !appData.autoFlipView;
+    return;
+}
+
 void ShowThinkingProc(object, user_data)
      GtkObject *object;
      gpointer user_data;
@@ -467,7 +493,7 @@ ResetProc (object, user_data)
      gpointer user_data;
 {
   ResetGameEvent();
-  AnalysisPopDown();
+  EngineOutputPopDown();
 }
 
 void WhiteClockProc(object, user_data)