X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=gtk-gui.c;h=7db777ab92e4254fdb14644ad2ac2c9348387dc4;hb=refs%2Fheads%2Fmaster;hp=bc8e6e00097e8f8c4f51cb00b3eaadedf415b5d6;hpb=c89f88378a0a19d6b7e0771b6fd8dc31acfaf2f7;p=ext%2Fsubsurface.git diff --git a/gtk-gui.c b/gtk-gui.c index bc8e6e0..7db777a 100644 --- a/gtk-gui.c +++ b/gtk-gui.c @@ -262,7 +262,7 @@ static gboolean ask_save_changes() label = gtk_label_new ( "You have unsaved changes\nWould you like to save those before exiting the program?"); } else { - char *label_text = (char*) malloc(sizeof(char) * (92 + strlen(existing_filename))); + char *label_text = (char*) malloc(sizeof(char) * (93 + strlen(existing_filename))); sprintf(label_text, "You have unsaved changes to file: %s \nWould you like to save those before exiting the program?", existing_filename); @@ -729,6 +729,13 @@ static void view_three(GtkWidget *w, gpointer data) gtk_paned_set_position(GTK_PANED(vpane), requisition.height + 6); } +static void toggle_zoom(GtkWidget *w, gpointer data) +{ + zoomed_plot = (zoomed_plot)?0 : 1; + /*Update dive*/ + repaint_dive(); +} + static GtkActionEntry menu_items[] = { { "FileMenuAction", NULL, "File", NULL, NULL, NULL}, { "LogMenuAction", NULL, "Log", NULL, NULL, NULL}, @@ -749,7 +756,8 @@ static GtkActionEntry menu_items[] = { { "ViewList", NULL, "List", CTRLCHAR "1", NULL, G_CALLBACK(view_list) }, { "ViewProfile", NULL, "Profile", CTRLCHAR "2", NULL, G_CALLBACK(view_profile) }, { "ViewInfo", NULL, "Info", CTRLCHAR "3", NULL, G_CALLBACK(view_info) }, - { "ViewThree", NULL, "Three", CTRLCHAR "4", NULL, G_CALLBACK(view_three) }, + { "ViewThree", NULL, "Three", CTRLCHAR "4", NULL, G_CALLBACK(view_three) }, + { "ToggleZoom", NULL, "Toggle Zoom", CTRLCHAR "0", NULL, G_CALLBACK(toggle_zoom) }, }; static gint nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]); @@ -771,6 +779,7 @@ static const gchar* ui_string = " \ \ \ \ + \ \ \ \