[gnome-games/sudoku-vala] sudoku: Number picker works again



commit e3eba0f3ecb3120b1c8491934bb0da6f20453ad6
Author: LubomÃr SedlÃÅ <lubomir sedlar gmail com>
Date:   Mon Jun 27 22:25:40 2011 +0200

    sudoku: Number picker works again
    
    The handler was changed to lambda expression so as to allow packing of
    the value.

 gnome-sudoku/src/sudoku-view.vala |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/gnome-sudoku/src/sudoku-view.vala b/gnome-sudoku/src/sudoku-view.vala
index ab19376..478b1e0 100644
--- a/gnome-sudoku/src/sudoku-view.vala
+++ b/gnome-sudoku/src/sudoku-view.vala
@@ -108,7 +108,10 @@ private class SudokuCellView : Gtk.DrawingArea
                 button.add (label);
                 label.show ();
                 
-                button.clicked.connect (picker_button_cb);
+                button.clicked.connect (() => {
+                    cell.value = n;
+                    hide_number_picker ();
+                });
 
                 if (n == 5)
                     button.grab_focus ();
@@ -131,11 +134,6 @@ private class SudokuCellView : Gtk.DrawingArea
         popup = null;
     }
 
-    private void picker_button_cb (Gtk.Button button)
-    {
-        hide_number_picker ();
-    }
-
     private bool focus_out_cb (Gtk.Widget widget, Gdk.EventFocus event)
     {
         if (popup != null)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]