{
};
-G_DEFINE_TYPE (GtkMapserver, gtk_mapserver, G_TYPE_OBJECT)
+G_DEFINE_TYPE (GtkMapserver, gtk_mapserver, GOO_TYPE_CANVAS)
#ifdef G_OS_WIN32
static HMODULE hmodule;
GtkMapserverPrivate *priv = GTK_MAPSERVER_GET_PRIVATE (gtk_mapserver);
}
-GtkMapserver
+GtkWidget
*gtk_mapserver_new ()
{
gchar *localedir;
- GtkMapserver *gtk_mapserver = GTK_MAPSERVER (g_object_new (gtk_mapserver_get_type (), NULL));
+ GtkWidget *gtk_mapserver = GTK_WIDGET (g_object_new (gtk_mapserver_get_type (), NULL));
- GtkMapserverPrivate *priv = GTK_MAPSERVER_GET_PRIVATE (gtk_mapserver);
+ GtkMapserverPrivate *priv = GTK_MAPSERVER_GET_PRIVATE (GTK_MAPSERVER (gtk_mapserver));
#ifdef G_OS_WIN32
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
+#include <goocanvas.h>
G_BEGIN_DECLS
struct _GtkMapserver
{
- GObject parent;
+ GooCanvas parent;
};
struct _GtkMapserverClass
{
- GObjectClass parent_class;
+ GooCanvasClass parent_class;
};
GType gtk_mapserver_get_type (void) G_GNUC_CONST;
-GtkMapserver *gtk_mapserver_new (void);
+GtkWidget *gtk_mapserver_new (void);
G_END_DECLS
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <stdlib.h>
+
#include "gtkmapserver.h"
+/* This is our handler for the "delete-event" signal of the window, which
+ is emitted when the 'x' close button is clicked. We just exit here. */
+static gboolean
+on_delete_event (GtkWidget *window,
+ GdkEvent *event,
+ gpointer unused_data)
+{
+ exit (0);
+}
+
int
main (int argc, char **argv)
{
+ GtkWidget *window;
+ GtkWidget *gtkmap;
+
+ /* Initialize GTK+. */
+ gtk_init (&argc, &argv);
+
+ /* Create the window and widgets. */
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_default_size (GTK_WINDOW (window), 640, 600);
+ gtk_widget_show (window);
+ g_signal_connect (window,
+ "delete_event", G_CALLBACK (on_delete_event),
+ NULL);
+
+ /* Pass control to the GTK+ main event loop. */
+ gtk_main ();
return 0;
}