GDK starting



Hi,
please tell me what I need to add in the following source just to display 
black square in window:

/******************/
#include <gtk/gtk.h>
int main (int argc, char *argv[])
     {
       GtkWidget *window;
       GtkWidget *drawing_area;
       gtk_init (&argc, &argv);
       window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
       drawing_area = gtk_drawing_area_new ();
       gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 200, 200);
       gtk_container_add (GTK_CONTAINER (window), drawing_area);
       gtk_widget_show (drawing_area);
       gtk_widget_show (window);

       gdk_draw_rectangle (drawing_area->window,
                           drawing_area->style->black_gc,
			   TRUE,
			   0,0,
			   drawing_area->allocation.width,
			   drawing_area->allocation.height);
       gtk_main ();
       return 0;
     }
/******************/

Thanks,
Sasha

_____
Alexander Kotelnikov
Saint-Petersburg, Russia
mailto:sasha@ak2614.spb.edu




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