Need help with gdk_draw_*



I am trying to learn how to use the various gdk_draw_* routines, so far
without success. I read the tutorial, especially the Scribble drawing
program part, yet I can't get the following code to work. If I understood
what I read, I should be getting a 200x200 pixel window with a white
rectangle inside of it; instead I just get the 200x200 pixel window.

I'd appreciate any insights. Actually, the Scribble part of the tutorial
refers the reader to the complete source code for Scribble, which I can't
find. I'd prefer it if someone just pointed me to the source code since I'd
like to tackle it all myself - I feel I learn better that way. I though
maybe I'd look at the gzilla sources but I am still too novice to
comprehend programs of that size easily.

	Thanks,
	Yoav


#include <gtk/gtk.h>

int main(int argc, char *argv[])
{
	GtkWidget *mainwin;

	gtk_init(&argc, &argv);
	mainwin=gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_widget_show(mainwin);

	gdk_draw_rectangle(mainwin->window, mainwin->style->white_gc, 				TRUE,
50, 50, 150, 150);

	gtk_main();
	return 0;
}



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