diff options
Diffstat (limited to 'tikzit')
-rw-r--r-- | tikzit/src/gtk/Application.m | 3 | ||||
-rw-r--r-- | tikzit/src/gtk/ToolBox.m | 9 |
2 files changed, 3 insertions, 9 deletions
diff --git a/tikzit/src/gtk/Application.m b/tikzit/src/gtk/Application.m index 38ef231..ecaec6d 100644 --- a/tikzit/src/gtk/Application.m +++ b/tikzit/src/gtk/Application.m @@ -109,13 +109,14 @@ Application* app = nil; [BoundingBoxTool tool], [HandTool tool], nil]; + activeTool = [tools objectAtIndex:0]; for (id<Tool> tool in tools) { [tool loadConfiguration:configFile]; } - activeTool = [[tools objectAtIndex:0] retain]; toolBox = [[ToolBox alloc] initWithTools:tools]; [toolBox loadConfiguration:configFile]; + [toolBox setSelectedTool:activeTool]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(selectedToolChanged:) diff --git a/tikzit/src/gtk/ToolBox.m b/tikzit/src/gtk/ToolBox.m index 5c7473d..d7c991d 100644 --- a/tikzit/src/gtk/ToolBox.m +++ b/tikzit/src/gtk/ToolBox.m @@ -38,6 +38,7 @@ static void unretain (gpointer data); if (self) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + g_object_ref_sink (window); gtk_window_set_title (GTK_WINDOW (window), "Toolbox"); gtk_window_set_role (GTK_WINDOW (window), "toolbox"); gtk_window_set_type_hint ( @@ -62,8 +63,6 @@ static void unretain (gpointer data); gtk_container_add (GTK_CONTAINER (toolPalette), GTK_WIDGET (toolGroup)); gtk_widget_show (GTK_WIDGET (toolGroup)); - id<Tool> activeTool = [app activeTool]; - GSList *item_group = NULL; for (id<Tool> tool in tools) { NSString *tooltip = [NSString stringWithFormat: @@ -86,12 +85,6 @@ static void unretain (gpointer data); [tool retain], unretain); - if (tool == activeTool) { - gtk_toggle_tool_button_set_active ( - GTK_TOGGLE_TOOL_BUTTON (item), - TRUE); - } - g_signal_connect (item, "toggled", G_CALLBACK (tool_button_toggled_cb), self); |