GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Aug 30, 2014 8:15 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Gdk Window?
PostPosted: Tue Jan 29, 2008 3:46 am 
Offline
GTK+ Guru

Joined: Thu Jun 21, 2007 1:52 pm
Posts: 198
Location: Wilkes Barre Pa
Anyone have any idea about how to use gdk to make a window?

This is what i have so far the code compiles but when i execute the compiled binary nothing happens i did a ps -A check and what ya know the app wasn't running.

Code:
#include <gdk/gdk.h>

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

    GdkWindowAttr         attr;
    GdkWindow             *win;

    gdk_init(&argc,&argv);
   
    attr.window_type = GDK_WINDOW_TOPLEVEL;
    attr.wclass = GDK_INPUT_OUTPUT;
    attr.event_mask = GDK_STRUCTURE_MASK;

    win = gdk_window_new(NULL,&attr,0);
     
    gdk_window_show(win);
   
    return 0;
}


Here is how i am compiling the code
[code=]
gcc test.c -o test `pkg-config --cflags --libs gdk-2.0`
[/code]

There are no errors thrown.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 29, 2008 2:46 pm 
Offline
Familiar Face

Joined: Wed Dec 19, 2007 5:06 pm
Posts: 13
I'm the furthest thing from an expert on this, but my impression is that you should be using GTK to create a window, and GDK to actually draw in it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group