summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 36bc7dd)
raw | patch | inline | side by side (parent: 36bc7dd)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 18 Aug 2006 06:09:10 +0000 (06:09 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 18 Aug 2006 06:09:10 +0000 (06:09 +0000) |
src/widgets/toolbox.cpp | patch | blob | history |
index 0849bda64937982dd3c006965b600fdc79f7421b..ed9259aef9b93d340e37f0124c0f5b859dbe2733 100644 (file)
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
free (sample_escaped);
}
+static void delete_completion(GObject *obj, GtkWidget *entry) {
+ GObject *completion = (GObject *) gtk_object_get_data(GTK_OBJECT(entry), "completion");
+ if (completion) {
+ gtk_entry_set_completion (GTK_ENTRY(entry), NULL);
+ g_object_unref (completion);
+ }
+}
+
GtkWidget*
sp_text_toolbox_new (SPDesktop *desktop)
{
gtk_entry_completion_set_minimum_key_length (completion, 1);
g_object_set (G_OBJECT(completion), "inline-completion", TRUE, "popup-completion", TRUE, NULL);
gtk_entry_set_completion (GTK_ENTRY(entry), completion);
+ gtk_object_set_data(GTK_OBJECT(entry), "completion", completion);
aux_toolbox_space (tbl, 1);
gtk_box_pack_start (GTK_BOX (tbl), entry, FALSE, FALSE, 0);
+ g_signal_connect(G_OBJECT(tbl), "destroy", G_CALLBACK(delete_completion), entry);
//Button
GtkWidget *button = gtk_button_new ();