Ignore:
Timestamp:
Aug 13, 2011, 10:05:53 PM (11 years ago)
Author:
sam
Message:

gtk: refactor the GTK mess once again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/deushax/gtk/editor.cpp

    r824 r825  
    2222
    2323#include "glmapview.h"
    24 
    25 /* Closing the window does not quit directly, we must first make sure the
    26  * GL widget is destroyed cleanly. */
    27 static gboolean close_window(GtkWidget *w, GdkEvent *e, void *data)
    28 {
    29     (void)w;
    30     (void)e;
    31     GlMapView *glmapview = (GlMapView *)data;
    32     glmapview->Shutdown();
    33     gtk_main_quit();
    34     return FALSE;
    35 }
    3624
    3725int main(int argc, char **argv)
     
    6048
    6149    /* Add our custom GL map viewer */
    62     GlMapView *glmapview = new GlMapView(builder);
     50    GlMapView *glmapview = new GlMapView(
     51           GTK_CONTAINER(gtk_builder_get_object(builder, "gl_container")),
     52           GTK_ADJUSTMENT(gtk_builder_get_object(builder, "gl_hadj")),
     53           GTK_ADJUSTMENT(gtk_builder_get_object(builder, "gl_vadj")));
    6354
    6455    /* Show window. We're good to go! */
    6556    GtkWidget *window = GTK_WIDGET(gtk_builder_get_object(builder, "window"));
    6657    gtk_widget_show_all(window);
    67     gtk_signal_connect(GTK_OBJECT(window), "delete_event",
    68                        GTK_SIGNAL_FUNC(close_window), glmapview);
     58    g_signal_connect(GTK_OBJECT(window), "delete_event",
     59                     GTK_SIGNAL_FUNC(gtk_main_quit), glmapview);
     60    g_signal_connect(GTK_OBJECT(window), "delete_event",
     61                     GTK_SIGNAL_FUNC(gtk_main_quit), glmapview2);
    6962    g_object_unref(G_OBJECT(builder));
    7063
Note: See TracChangeset for help on using the changeset viewer.