public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); panel = new Panel(vbox1); //Bombo bombo = new Bombo(); BJugar.Clicked += delegate { int numero = bombo.sacarBola(); panel.Marcar(numero); }; }
protected void OnBJugarClicked(object sender, EventArgs e) { /*Bombo bombo = new Bombo();*/ int numero = bombo.sacarBola(); panel.Marcar(numero); }
protected void OnBJugarClicked(object sender, EventArgs e) { int x; Bombo bombo1 = new Bombo(); x = bombo1.sacarBola(); }
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 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); * };*/ }
protected void OnButton1Clicked(object sender, EventArgs e) { int numero = bombo.sacarBola(); panel.Marcar(numero); }