public PlayerPage(ICSGameObserverWidget widget,
					   MoveDetails details)
                : base(widget,
								      details)
            {
                Table table = new Table (5, 2, true);

                  drawButton =
                    new Button (Catalog.
                            GetString ("Draw"));
                  resignButton =
                    new Button (Catalog.
                            GetString ("Resign"));
                  abortButton =
                    new Button (Catalog.
                            GetString ("Abort"));
                  adjournButton =
                    new Button (Catalog.
                            GetString ("Adjourn"));
                  takebackButton =
                    new Button (Catalog.
                            GetString ("Takeback"));

                  drawButton.Clicked += OnClicked;
                  resignButton.Clicked += OnClicked;
                  abortButton.Clicked += OnClicked;
                  adjournButton.Clicked += OnClicked;
                  takebackButton.Clicked += OnClicked;

                uint row = 0, col = 0;
                  table.Attach (drawButton, col, col + 1, row,
                        row + 1);
                  col++;
                  table.Attach (resignButton, col, col + 1,
                        row, row + 1);
                  col = 0;
                  row++;
                  table.Attach (abortButton, col, col + 1,
                        row, row + 1);
                  col++;
                  table.Attach (adjournButton, col, col + 1,
                        row, row + 1);
                  col = 0;
                  row++;
                  table.Attach (takebackButton, col, col + 1,
                        row, row + 1);
                  table.ShowAll ();
                  movesBox.PackEnd (table, false, true, 2);
            }
            public PlayerPage(ICSGameObserverWidget widget,
					   MoveDetails details)
                : base(widget,
								      details)
            {
                HButtonBox box = new HButtonBox ();

                  drawButton =
                    new Button (Catalog.
                            GetString ("Draw"));
                  resignButton =
                    new Button (Catalog.
                            GetString ("Resign"));
                  abortButton =
                    new Button (Catalog.
                            GetString ("Abort"));
                  adjournButton =
                    new Button (Catalog.
                            GetString ("Adjourn"));
                  takebackButton =
                    new Button (Catalog.
                            GetString ("Takeback"));

                  drawButton.Clicked += OnClicked;
                  resignButton.Clicked += OnClicked;
                  abortButton.Clicked += OnClicked;
                  adjournButton.Clicked += OnClicked;
                  takebackButton.Clicked += OnClicked;

                  box.LayoutStyle = ButtonBoxStyle.Start;
                  box.PackStart (drawButton, false, false, 2);
                  box.PackStart (resignButton, false, false,
                         2);
                  box.PackStart (abortButton, false, false,
                         2);
                  box.PackStart (adjournButton, false, false,
                         2);
                  box.PackStart (takebackButton, false, false,
                         2);
                  box.ShowAll ();
                  PackStart (box, false, true, 2);
            }
 private void RemoveGamesUI()
 {
     client.CommandSender.SendCommand ("unobserve");	// unobserve all!
     /*
        int width, height;
        win.GetSize (out width, out height);
        App.Session.ICSGamesWinWidth = width;
        App.Session.ICSGamesWinHeight = height;
      */
     App.Session.ICSGamesWinSplitPanePosition =
         win.SplitPane.Position;
     int index = appwidget.Book.PageNum (win);
     appwidget.Book.RemovePage (index);
     win = null;
 }
            private void OnMoveMade(object o,
						 MoveMadeEventArgs args)
            {
                MoveDetails details = args.Details;

                if (details.relation != Relation.IamObserving
                    && details.relation !=
                    Relation.IamObservingGameBeingObserved
                    && details.relation !=
                    Relation.IamPlayingAndMyMove
                    && details.relation !=
                    Relation.IamPlayingAndMyOppsMove)
                    return;

                if (win != null)
                  {
                      win.Update (details);
                      return;
                  }
                win = new ICSGameObserverWidget (client);
                win.GamePageRemovedEvent += OnGamePageRemoved;
                win.GamePageAddedEvent += OnGamePageAdded;
                gamesPageLabel = new Label ();
                appwidget.Book.AppendPage (win,
                               gamesPageLabel);
                win.ShowAll ();
                win.Update (details);

                if (gameInfos.
                    ContainsKey (details.gameNumber))
                  {
                      GameInfo info =
                          (GameInfo)
                          gameInfos[details.
                                gameNumber];
                      gameInfos.Remove (details.
                                gameNumber);
                      win.Update (info);
                  }

                /*
                   win.Resize (App.Session.ICSGamesWinWidth,
                   App.Session.ICSGamesWinHeight);
                 */
                win.SplitPane.Position =
                    App.Session.
                    ICSGamesWinSplitPanePosition;

                appwidget.MakeVisible ();
            }
            public ObservingGamePage(ICSGameObserverWidget
						  widget,
						  MoveDetails details)
                : base()
            {
                this.win = widget;
                gameId = details.gameNumber;

                InitGameWidget (details);

                movesWidget = new ChessMovesWidget ();
                movesWidget.CursorChanged += OnCursorChanged;

                gameWidget.WhiteAtBottom =
                    !details.blackAtBottom;
                board.side = details.blackAtBottom;
                gameWidget.whiteClock.Configure (details.
                                 initial_time
                                 * 60,
                                 (uint)
                                 details.
                                 increment);
                gameWidget.blackClock.Configure (details.
                                 initial_time
                                 * 60,
                                 (uint)
                                 details.
                                 increment);

                white = details.white;
                black = details.black;
                gameWidget.White = white;
                gameWidget.Black = black;

                gameWidget.Show ();
                board.Show ();
                movesWidget.Show ();

                HBox box = new HBox ();
                Button closeButton;
                if (Config.WindowsBuild)
                    closeButton =
                        new Button (Stock.Close);
                else
                  {
                      closeButton = new Button ("");
                      closeButton.Image =
                          new Image (Stock.Close,
                                 IconSize.Menu);
                  }
                resultLabel = new Label ();
                resultLabel.Xalign = 0;
                box.PackStart (resultLabel, true, true, 2);
                box.PackStart (closeButton, false, false, 2);

                PackStart (box, false, true, 2);

                box = new HBox ();
                ScrolledWindow scroll = new ScrolledWindow ();
                scroll.HscrollbarPolicy = PolicyType.Never;
                scroll.VscrollbarPolicy =
                    PolicyType.Automatic;
                scroll.Add (movesWidget);

                VBox movesBox = new VBox ();
                movesBox.PackStart (scroll, true, true, 2);
                AddGameNavigationButtons (movesBox);

                box.PackStart (gameWidget, true, true, 2);
                box.PackStart (movesBox, false, true, 2);
                PackStart (box, true, true, 2);

                closeButton.Clicked += OnCloseButtonClicked;

                Update (details);
                ShowAll ();
            }