1d5ffdc631df5397f9d1cddd3556cc2e5019fe36
2 * gtk.c: GTK front end for my puzzle collection.
13 /* ----------------------------------------------------------------------
14 * Error reporting functions used elsewhere.
17 void fatal(char *fmt
, ...)
21 fprintf(stderr
, "fatal error: ");
24 vfprintf(stderr
, fmt
, ap
);
27 fprintf(stderr
, "\n");
31 /* ----------------------------------------------------------------------
32 * GTK front end to puzzles.
36 * This structure holds all the data relevant to a single window.
37 * In principle this would allow us to open multiple independent
38 * puzzle windows, although I can't currently see any real point in
39 * doing so. I'm just coding cleanly because there's no
40 * particularly good reason not to.
46 static void destroy(GtkWidget
*widget
, gpointer data
)
51 static struct window_data
*new_window(void)
53 struct window_data
*wdata
;
55 wdata
= snew(struct window_data
);
57 wdata
->window
= gtk_window_new(GTK_WINDOW_TOPLEVEL
);
58 gtk_signal_connect(GTK_OBJECT(wdata
->window
), "destroy",
59 GTK_SIGNAL_FUNC(destroy
), wdata
);
60 gtk_widget_show(wdata
->window
);
64 int main(int argc
, char **argv
)
66 gtk_init(&argc
, &argv
);