summaryrefslogtreecommitdiff
path: root/src/gtkext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-10-22 10:00:41 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-10-22 10:00:41 (GMT)
commit3a259b1e1e3fe870f9d1837ea2ecf6ce5c1d0162 (patch)
tree08cc7f88479ce391b0e94241edd6a181c34664c8 /src/gtkext
parentd800cb1c80ec68eb1ad85134fd9c0727023f572a (diff)
Fixed GUI bugs in the case where no binary is loaded.
Diffstat (limited to 'src/gtkext')
-rw-r--r--src/gtkext/gtkbinarystrip.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gtkext/gtkbinarystrip.c b/src/gtkext/gtkbinarystrip.c
index 0ad0763..9a1b827 100644
--- a/src/gtkext/gtkbinarystrip.c
+++ b/src/gtkext/gtkbinarystrip.c
@@ -436,13 +436,21 @@ static gboolean gtk_binary_strip_query_tooltip(GtkWidget *widget, gint x, gint y
void gtk_binary_strip_attach(GtkBinaryStrip *strip, GLoadedBinary *binary)
{
+ GtkWidget *widget; /* Autre version du composant */
+
if (strip->binary != NULL)
g_object_unref(G_OBJECT(strip->binary));
strip->binary = binary;
- g_object_ref(G_OBJECT(strip->binary));
- gtk_widget_queue_draw(GTK_WIDGET(strip));
+ if (strip->binary != NULL)
+ g_object_ref(G_OBJECT(strip->binary));
+
+ widget = GTK_WIDGET(strip);
+
+ gtk_widget_set_sensitive(widget, strip->binary != NULL);
+
+ gtk_widget_queue_draw(widget);
}