Differences From Artifact [508aa0ef899fe75c]:
- File        
src/gui.d
- 2012-07-14 12:29:17 - part of checkin [9d4aca73fa] on branch trunk - GUI+Solver revived. (user: kinaba) [annotate]
 
To Artifact [4cc6400795e7a727]:
- File        
src/gui.d
- 2012-07-14 12:51:48 - part of checkin [8a59754e60] on branch trunk - GUI auto solver. (user: kinaba) [annotate]
 
   13                  setup_keyhandling();                                                  13                  setup_keyhandling();
   14                  draw(g);                                                              14                  draw(g);
   15          }                                                                             15          }
   16                                                                                        16  
   17          private void delegate(char c) fn;                                             17          private void delegate(char c) fn;
   18          void set_fn(F)(F f) { this.fn = f; }                                          18          void set_fn(F)(F f) { this.fn = f; }
   19                                                                                        19  
   20          void run()                                                               |    20          void run(bool automate = false)
   21          {                                                                             21          {
                                                                                        >    22                  if(automate) {
                                                                                        >    23                          Timer t = new Timer;
                                                                                        >    24                          t.interval = 100;
                                                                                        >    25                          t.tick ~= (Timer sender, EventArgs ea){
                                                                                        >    26                                  fn(solver.single_step());
                                                                                        >    27                          };
                                                                                        >    28                          t.start();
                                                                                        >    29                  }
   22                  Application.run(this);                                                30                  Application.run(this);
   23          }                                                                             31          }
   24                                                                                        32  
   25          override void on_game_changed(char c, const(Game) g, bool finished)           33          override void on_game_changed(char c, const(Game) g, bool finished)
   26          {                                                                             34          {
   27                  draw(g);                                                              35                  draw(g);
   28          }                                                                             36          }