Gdk window



Dear friends,
I am a beginer and working with GDK. I want to display a gdk
window. For that I wrote a small program as follows:
-------------------------- start.c ----------------------------------
#include<gtk/gtk.h>
#include<gdk/gdk.h>

int main(int argc, char *argv[])
{
        GdkDrawable *window;
        GdkWindowAttr attr;
        gint mask=0xFE20;

        window = NULL;

        // Initialization of the Attributes

        attr.title="T";       // I want title "T"
        attr.event_mask=0x3FFE; // Complete event mask
        attr.x = 0;             // To initialize window at 0,0
        attr.y= 0;
        attr.width = 400;       // To specify the dimensions 400x400
        attr.height = 400;
        attr.wclass = GDK_INPUT_OUTPUT;
        attr.window_type = GDK_WINDOW_TOPLEVEL;

        // End of initialization

        gdk_init(&argc,&argv);

        window = gdk_window_new(window,&attr,mask);
        gdk_window_show(window);

        return 0;

}

--------------------------- start.c ------------------------------

This start.c file I compiled with the GCC using comindline as,

gcc start.c -o start `gtk-config --cflags --libs`

The program compiled without warnings or errors but, when I execute
start I get a segmentation fault.
I am screwed a lot by this progam. Can anyone send me the runnable
code.

Waiting for response Bye...
                   Sachin







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