public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); Panel panel = new Panel(caja); Bombo bombo = new Bombo(); buttonSiguiente.Clicked += delegate { int numero = bombo.sacarBola(); panel.Marcar(numero); buttonSiguiente.Sensitive = bombo.quedanBolas(); //if (!bombo.quedanBolas()) //buttonSiguiente.Sensitive = false; }; ////Button[] buttons = new Button[90] //Random random = new Random(); //List<int> numeros = new List<int>(); //numeros = rellenarLista(numeros); //List<Button> buttons = new List<Button>(); //for (int i = 1; i < 91; i++){ // Button button = new Button(); // button.Label = i.ToString(); // buttons.Add(button); //} //int cont = 0; //for (int row = 0; row < 9; row++) // for (int column = 0; column < 10; column++) // { // Button button = buttons[cont]; // cont++; // table.Attach(button, (uint)column, (uint)column + 1, (uint)row, (uint)row+1); // } //table.ShowAll(); //cont = 90; //buttonSiguiente.Clicked += delegate { // int numAleatorio = random.Next(cont)-1; // labelNumero.Text = numeros[numAleatorio].ToString(); // buttons[numeros[numAleatorio]].ModifyBg(StateType.Normal, COLOR_GREEN); // numeros.Remove(numeros[numAleatorio]); // cont--; //}; }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); Panel panel = new Panel(vBox); Bombo bombo = new Bombo(); button2.Clicked += delegate { int numero = bombo.sacarBola(); Console.WriteLine("Se ha de marcar el número: " + numero); panel.Marcar(numero); button2.Sensitive = bombo.quedanBolas(); }; }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); Panel panel = new Panel(vbox); Bombo bombo = new Bombo(); buttonAdelante.Clicked += delegate { int numero = bombo.sacarBola(); panel.Marcar(32); buttonAdelante.Sensitive = bombo.quedanBolas(); Console.WriteLine("Pulsado boton adelante"); }; }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); Panel panel = new Panel(vBox); Bombo bombo = new Bombo(); buttonAdelante.Clicked += delegate { int num = bombo.SacarBola(); panel.Marcar(num); buttonAdelante.Sensitive = bombo.quedanBolas(); //if (!bombo.quedanBolas()) // buttonAdelante.Sensitive = false; }; }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); Panel panel = new Panel(vBox); Bombo bombo = new Bombo(); buttonAdelante.Clicked += delegate { int numero = bombo.sacarBola(); panel.Marcar(numero); buttonAdelante.Sensitive = bombo.quedanBolas(); //if (!bombo.quedanBolas()) //buttonAdelante.Sensitive = false; Console.WriteLine("buttonAdelante pulsado"); }; }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); Panel panel = new Panel(vbox1); Bombo bombo = new Bombo(); buttonAdelante.Clicked += delegate { int numero = bombo.sacarBola(); panel.Marcar(numero); if (!bombo.quedanBolas()) { buttonAdelante.Sensitive = false; } Console.WriteLine("buttonAdelante pulsado"); }; //Button[] buttons = new Button[90];// /* List<Button> buttons = new List<Button>(); * * int num = 1; * for (int row = 0; row < 9; row++) * { * for (int column = 0; column < 10; column++) * { * Button button = new Button(); * button.Label = num++.ToString(); * table.Attach(button, (uint)column, (uint)column + 1, (uint)row, (uint)row + 1); * buttons.Add(button); * } * } * * table.ShowAll(); * * Random random = new Random(); * buttonAdelante.Clicked += delegate * { * int numeroAleatorio = random.Next(90) + 1; * labelNumero.Text = numeroAleatorio.ToString(); * buttons[numeroAleatorio - 1].ModifyBg(StateType.Normal, COLOR_CIAN); * };*/ }