1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| void get_souris(GtkWidget *widget,GdkEventButton *event, gpointer mode){nt x=event->x/24;
int y=event->y/12;
int t[x][y];
if(t[x][y]==0){
image1=gdk_pixmap_create_from_xpm(rectangle->window,NULL,&rectangle->style->black,"image1.xpm");
t[x][y]=1;
gdk_draw_pixmap(rectangle->window,rectangle->style->fg_gc[GTK_WIDGET_STATE (rectangle)],image1,0,0,x*24 ,y*24 ,24,24);
}
else {
image2=gdk_pixmap_create_from_xpm(rectangle->window,NULL,rectangle->style->black,"image2.xpm");
t[x][y]=2;
gdk_draw_pixmap(rectangle->window,rectangle->style->fg_gc[GTK_WIDGET_STATE (rectangle)],image2,0,0,x*24 ,y*24 ,24,24);
}
} |
Partager