newbie question on gdk
- From: Michael Beach <mbeach zip com au>
- To: gtk-list redhat com
- Subject: newbie question on gdk
- Date: Wed, 25 Feb 1998 00:12:10 +1100
Hi. As a bit of a newbie to gtk, I decided to first try just playing
around with a few gdk functions to see how they worked. I have a simple
program (included below) which I thought should put a window on the
screen, wait 3 seconds then exit.
What it actually does is wait around for about 3 seconds, flash up a
window briefly, then exit immediately. Have I done something wrong, or
have I done things right, and this behaviour is expected but for a
reason that I am not aware of.
BTW, this is all with gtk+-0.99.2.
Thanks for any light shed...
Regards
M.Beach
/*
* hoax.c
*
* Some arbitrary hoaxing about with gdk, just to get a feel for it,
* before I jump in and start trying to write any cute RScheme
* interface.
*/
#include <unistd.h>
#include <gdk/gdk.h>
void main(int argc, char *argv[])
{
GdkWindow *my_window;
GdkWindowAttr my_attr;
GdkGC *my_gc;
/* initialise gdk */
gdk_init(&argc, &argv);
/* create a window */
my_attr.title = "wibble";
my_attr.wclass = GDK_INPUT_OUTPUT;
my_attr.window_type = GDK_WINDOW_TOPLEVEL;
my_attr.x = 100;
my_attr.y = 100;
my_attr.width = 250;
my_attr.height = 250;
my_window = gdk_window_new(NULL, &my_attr,
GDK_WA_TITLE|GDK_WA_X|GDK_WA_Y);
my_gc = gdk_gc_new(my_window);
/* show the window */
gdk_window_show(my_window);
gdk_window_clear(my_window);
sleep(3);
/* shut down gdk and exit the program */
gdk_exit(0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]