Re: why i can't draw the graphic??
- From: =?gb2312?b?6Zkg6IM=?= <bdragon2001 hotmail com>
- To: guinan bluebutton com
- Cc: gnome-devel-list gnome org
- Subject: Re: why i can't draw the graphic??
- Date: Thu, 11 Jul 2002 09:23:13 +0800
hi,jamie
sorry,i have made a mistake.But it is not the important one,even use
the"GTK_OBJECT(drawing_area)",i just can't seen the graphic.
Here is the code:
int main(int argc,char *argv[])
{
GtkWidget *Mainwindow;
GtkWidget *Vbox,*Hbox,*Drawing_area;
/*gtk initialization*/
gtk_init (&argc, &argv);
/*Mainwindown initiation*/
Mainwindow=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(Mainwindow),"vector map viewer");
gtk_container_border_width(GTK_CONTAINER(Mainwindow),10);
/*widget initiation */
Vbox=gtk_vbox_new(FALSE,0);
Drawing_area=gtk_drawing_area_new ();
gtk_drawing_area_size(Drawing_area,200,200);
/*widget allagement*/
gtk_container_add(GTK_CONTAINER(Mainwindow),Vbox);
/*show widgets */
gtk_widget_show(Vbox);
gtk_widget_show(Drawing_area);
gtk_widget_show(Mainwindow);
/*draw the line*/
gdk_draw_line (Drawing_area->window,
Drawing_area->style->black_gc,
100, 50, 50, 100);
/*loop*/
gtk_main();
return (0);
}
In it,i can't see the line drawed in the Drawing_area after it's
executed.Why?
Best regards,
_________________________________________________________________
享用世界上最大的电子邮件系统— MSN Hotmail。http://www.hotmail.com/cn
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]