diff options
Diffstat (limited to 'src/gtkext/gtkgraphview.c')
-rw-r--r-- | src/gtkext/gtkgraphview.c | 58 |
1 files changed, 6 insertions, 52 deletions
diff --git a/src/gtkext/gtkgraphview.c b/src/gtkext/gtkgraphview.c index 8a25940..dae1d54 100644 --- a/src/gtkext/gtkgraphview.c +++ b/src/gtkext/gtkgraphview.c @@ -37,8 +37,6 @@ struct _GtkGraphView { GtkBinView parent; /* A laisser en premier */ - GdkGC *gc; /* Contexte graphique du rendu */ - vmpa_t start; /* Début de la portion vue */ vmpa_t end; /* Fin de la portion affichée */ @@ -64,8 +62,6 @@ static void gtk_graph_view_class_init(GtkGraphViewClass *); /* Initialise une instance d'afficheur de code en graphique. */ static void gtk_graph_view_init(GtkGraphView *); -static void gtk_graph_view_realize(GtkWidget *widget); - /* Met à jour l'affichage de la vue sous forme graphique. */ static gboolean gtk_graph_view_expose(GtkGraphView *, GdkEventExpose *); @@ -107,7 +103,6 @@ static void gtk_graph_view_class_init(GtkGraphViewClass *klass) widget_class = (GtkWidgetClass *)klass; - widget_class->realize = gtk_graph_view_realize; widget_class->expose_event = gtk_graph_view_expose; } @@ -162,52 +157,6 @@ GtkWidget* gtk_graph_view_new(void) - - -static void -gtk_graph_view_realize(GtkWidget *widget) -{ - GdkWindowAttr attributes; - guint attributes_mask; - GdkColor white; /* Couleur de fond normale */ - - g_return_if_fail(widget != NULL); - g_return_if_fail(GTK_IS_GRAPH_VIEW(widget)); - - GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); - - attributes.window_type = GDK_WINDOW_CHILD; - attributes.x = widget->allocation.x; - attributes.y = widget->allocation.y; - attributes.width = widget->allocation.width; - attributes.height = widget->allocation.height; - - attributes.wclass = GDK_INPUT_OUTPUT; - attributes.event_mask = gtk_widget_get_events(widget) | GDK_BUTTON_PRESS_MASK | GDK_EXPOSURE_MASK; - - attributes_mask = GDK_WA_X | GDK_WA_Y; - - widget->window = gdk_window_new( - gtk_widget_get_parent_window (widget), - & attributes, attributes_mask - ); - - gdk_window_set_user_data(widget->window, widget); - - widget->style = gtk_style_attach(widget->style, widget->window); - - - gdk_color_white(gtk_widget_get_colormap(widget), &white); - gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &white); - - - GTK_GRAPH_VIEW(widget)->gc = gdk_gc_new(GDK_DRAWABLE(widget->window)); - -} - - - - /****************************************************************************** * * * Paramètres : view = composant GTK à redessiner. * @@ -226,7 +175,9 @@ static gboolean gtk_graph_view_expose(GtkGraphView *view, GdkEventExpose *event) size_t i; /* Boucle de parcours */ for (i = 0; i < view->links_count; i++) - gtk_link_renderer_draw(view->links[i], GDK_DRAWABLE(GTK_WIDGET(view)->window), view->gc); + gtk_link_renderer_draw(view->links[i], + GDK_DRAWABLE(GTK_WIDGET(view)->window), + GTK_BIN_VIEW(view)->gc); return FALSE; @@ -457,6 +408,7 @@ static GtkBinView **gtk_graph_view_load_nodes(openida_binary *binary, GRendering result[*count - 1] = GTK_BIN_VIEW(gtk_block_view_new()); gtk_widget_show(GTK_WIDGET(result[*count - 1])); + gtk_bin_view_show_border(result[*count - 1], true); gtk_bin_view_set_rendering_lines(result[*count - 1], binary, begin, end); begin = NULL; @@ -473,6 +425,7 @@ static GtkBinView **gtk_graph_view_load_nodes(openida_binary *binary, GRendering result[*count - 1] = GTK_BIN_VIEW(gtk_block_view_new()); gtk_widget_show(GTK_WIDGET(result[*count - 1])); + gtk_bin_view_show_border(result[*count - 1], true); gtk_bin_view_set_rendering_lines(result[*count - 1], binary, begin, end); begin = NULL; @@ -488,6 +441,7 @@ static GtkBinView **gtk_graph_view_load_nodes(openida_binary *binary, GRendering result[*count - 1] = GTK_BIN_VIEW(gtk_block_view_new()); gtk_widget_show(GTK_WIDGET(result[*count - 1])); + gtk_bin_view_show_border(result[*count - 1], true); gtk_bin_view_set_rendering_lines(result[*count - 1], binary, begin, end); } |