Revision 1078

View differences:

branches/simulator/projects/simulator/simulator/gui/gtk_gui.c
14 14
GtkWidget* window;
15 15
GtkWidget* view = NULL;
16 16

  
17
int robots_paused = 0;
18

  
17 19
void destroy_callback(int arg)
18 20
{
19 21
	robots_cleanup();
......
58 60
			break;
59 61
		case PAUSE:
60 62
			gdk_threads_leave();
61
			robots_pause();
63
			if (robots_paused)
64
				robots_resume();
65
			else
66
				robots_pause();
67
			robots_paused = !robots_paused;
62 68
			gdk_threads_enter();
63 69
			break;
64 70
		case RESUME:
......
88 94
	g_signal_connect_swapped(G_OBJECT(menu_item), "activate",
89 95
		G_CALLBACK(menuhandler), (gint*)NEW_ROBOT);
90 96
	
91
	menu_item = gtk_menu_item_new_with_label("Pause");
97
	menu_item = gtk_check_menu_item_new_with_label("Paused");
98
	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_item), 0);
92 99
	gtk_widget_show(menu_item);
93 100
	gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), menu_item);
94 101
	g_signal_connect_swapped(G_OBJECT(menu_item), "activate",
95 102
		G_CALLBACK(menuhandler), (gint*)PAUSE);
96 103
	
97
	menu_item = gtk_menu_item_new_with_label("Resume");
98
	gtk_widget_show(menu_item);
99
	gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), menu_item);
100
	g_signal_connect_swapped(G_OBJECT(menu_item), "activate",
101
		G_CALLBACK(menuhandler), (gint*)RESUME);
102

  
103 104
	file_item = gtk_menu_item_new_with_label("File");
104 105
	gtk_widget_show(file_item);
105 106
	gtk_menu_item_set_submenu(GTK_MENU_ITEM(file_item), file_menu);

Also available in: Unified diff