gtk: added framework for gtk window resize handling

This commit is contained in:
punkrockguy318 2012-08-11 14:56:22 +00:00
parent 62afdc2f17
commit 6994e1ad10
1 changed files with 18 additions and 1 deletions

View File

@ -2351,6 +2351,21 @@ gint handleMouseClick(GtkWidget* widget, GdkEvent *event, gpointer callback_data
return 0;
}
void handle_resize(GtkWindow* win, GdkEvent* event, gpointer data)
{
// TODO this is a stub atm
// this should handle resizing so the emulation takes up as much
// of the GTK window as possible
// get new window width/height
int width, height;
width = event->configure.width;
height = event->configure.height;
//printf("DEBUG: new window size: %dx%d\n", width, height);
return;
}
int InitGTKSubsystem(int argc, char** argv)
{
GtkWidget* Menubar;
@ -2410,10 +2425,12 @@ int InitGTKSubsystem(int argc, char** argv)
g_signal_connect(G_OBJECT(evbox), "button-press-event", G_CALLBACK(handleMouseClick), NULL);
g_signal_connect(G_OBJECT(evbox), "button-release-event", G_CALLBACK(handleMouseClick), NULL);
g_signal_connect(MainWindow, "destroy-event", quit, NULL);
// signal handlers
g_signal_connect(MainWindow, "delete-event", quit, NULL);
g_signal_connect(MainWindow, "destroy-event", quit, NULL);
// resize handler
g_signal_connect(MainWindow, "configure-event", G_CALLBACK(handle_resize), NULL);
gtk_widget_show_all(MainWindow);