From 5f2cd35c377989e07b241870f89fdf87d851465d Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Sat, 4 Jul 2009 15:53:19 +0000 Subject: Improved the link lines management. git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@90 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a --- ChangeLog | 8 ++++++++ src/graph/layout.c | 2 ++ src/gtkext/gtkgraphview.c | 17 +++++++++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80646b7..bcbc54f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 09-07-03 Cyrille Bagard + * src/graph/layout.c: + Be sure the link lines are drawn. + + * src/gtkext/gtkgraphview.c: + Reset the link lines. + +09-07-03 Cyrille Bagard + * src/analysis/binary.c: * src/analysis/binary.h: * src/analysis/line.c: diff --git a/src/graph/layout.c b/src/graph/layout.c index 93d6b28..725d76c 100644 --- a/src/graph/layout.c +++ b/src/graph/layout.c @@ -97,6 +97,8 @@ bool build_graph_view(GtkGraphView *view, GtkBinView **views, size_t count) links = create_links_from_graph_layout(layout, &links_count); gtk_graph_view_attach_links(view, links, links_count); + gtk_widget_queue_draw(GTK_WIDGET(view)); + delete_graph_layout(layout); /* TODO : free nodes */ diff --git a/src/gtkext/gtkgraphview.c b/src/gtkext/gtkgraphview.c index 14cd5b2..0db03f0 100644 --- a/src/gtkext/gtkgraphview.c +++ b/src/gtkext/gtkgraphview.c @@ -200,6 +200,21 @@ static void gtk_graph_view_reset(GtkGraphView *view) { size_t i; /* Boucle de parcours */ + view->start = 0; + view->end = 0; + + for (i = 0; i < view->links_count; i++) + gtk_object_destroy(view->links[i]); + + if (view->links_count > 0) + { + free(view->links); + view->links = NULL; + + view->links_count = 0; + + } + for (i = 0; i < view->childs_count; i++) gtk_widget_destroy(view->childs[i]); @@ -468,8 +483,6 @@ static GtkBinView **gtk_graph_view_load_nodes(openida_binary *binary, GRendering void gtk_graph_view_attach_links(GtkGraphView *view, GtkLinkRenderer **links, size_t count) { - /* TODO : free ? */ - view->links = links; view->links_count = count; -- cgit v0.11.2-87-g4458