how to draw something on GtkDrawingArea when I click a button?



Hi,everyone!

I want to draw something on GtkDrawingArea when I click a GtkButton,but I
don't know how to do this...

this is my code(it doesn't work...):

*void click_button(void){


gdk_draw_line(drawing_area,drawing_area->style->white_gc,x,y,width+x,height+y);

}

int main(int argc,char *argv[]){
   ...
   g_signal_connect(button,"clicked",G_CALLBACK(click_button),NULL);
   ...
}*



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]