[C con Clase] Conseguido
Miguel
halowin3 en gmail.com
Mie Oct 19 15:32:47 CEST 2011
He tenido que poner la struct como global:
struct bloque{
GtkWidget *l1;
GtkWidget *l2;
};
struct bloque bl;
.....
.....
//creo las labels
label1=gtk_label_new("Soy la 1");
label2=gtk_label_new("Soy la 2");
bl.l1 = label1;
bl.l2 = label2;
//creo el boton1
boton1 = gtk_button_new_with_label("cambialas");
g_signal_connect (GTK_BUTTON (boton1), "clicked",G_CALLBACK (clik1),&bl);
----- CALLBACK ----
void clik1( GtkWidget *widget, gpointer data ){
struct bloque *qq;
qq = (struct bloque *)data;
gtk_label_set_text(GTK_LABEL(qq->l1),"Me han cambiado 1");
gtk_label_set_text(GTK_LABEL(qq->l2),"Me han cambiado 2");
}
Gracias.
--
Miguel
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.conclase.net/pipermail/cconclase_listas.conclase.net/attachments/20111019/5cf664cd/attachment.html>
Más información sobre la lista de distribución Cconclase