diff options
author | Jeff Garzik <jgarzik@src.gnome.org> | 1999-01-21 00:37:48 +0000 |
---|---|---|
committer | Jeff Garzik <jgarzik@src.gnome.org> | 1999-01-21 00:37:48 +0000 |
commit | 6e3e247b9a1cdc7fec2197dceda35752f38c8003 (patch) | |
tree | 68c8ba7e932c79152d43cb4580fde846eaa102b1 | |
parent | df21a7064f0c5130d84e035f820eae197024992b (diff) | |
download | gtk+-6e3e247b9a1cdc7fec2197dceda35752f38c8003.tar.gz |
. Free 'nprefix', closing a memory leak. Spaced out the code a bit to make
.
* gtk/gtkcombo.c (gtk_combo_entry_key_press):
Free 'nprefix', closing a memory leak.
Spaced out the code a bit to make it more readable.
* gtk/gtkhbox.[ch] (gtk_hbox_new),
gtk/gtkvbox.[ch] (gtk_vbox_new):
Change 'homogenous' arg from gint to gboolean.
* gtk/gtktogglebutton.[ch]:
New function gtk_toggle_button_get_active().
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 13 | ||||
-rw-r--r-- | gtk/gtkcombo.c | 32 | ||||
-rw-r--r-- | gtk/gtkhbox.c | 2 | ||||
-rw-r--r-- | gtk/gtkhbox.h | 2 | ||||
-rw-r--r-- | gtk/gtktogglebutton.c | 12 | ||||
-rw-r--r-- | gtk/gtktogglebutton.h | 1 | ||||
-rw-r--r-- | gtk/gtkvbox.c | 2 | ||||
-rw-r--r-- | gtk/gtkvbox.h | 2 |
14 files changed, 129 insertions, 15 deletions
@@ -1,3 +1,16 @@ +1999-01-20 Jeff Garzik <jgarzik@pobox.com> + + * gtk/gtkcombo.c (gtk_combo_entry_key_press): + Free 'nprefix', closing a memory leak. + Spaced out the code a bit to make it more readable. + + * gtk/gtkhbox.[ch] (gtk_hbox_new), + gtk/gtkvbox.[ch] (gtk_vbox_new): + Change 'homogenous' arg from gint to gboolean. + + * gtk/gtktogglebutton.[ch]: + New function gtk_toggle_button_get_active(). + 1999-01-20 Federico Mena Quintero <federico@nuclecu.unam.mx> * gtk/gtkdnd.c (gtk_drag_get_event_action): Allow button 2 to act diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 63d8f8766f..48d68cf5e4 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,16 @@ +1999-01-20 Jeff Garzik <jgarzik@pobox.com> + + * gtk/gtkcombo.c (gtk_combo_entry_key_press): + Free 'nprefix', closing a memory leak. + Spaced out the code a bit to make it more readable. + + * gtk/gtkhbox.[ch] (gtk_hbox_new), + gtk/gtkvbox.[ch] (gtk_vbox_new): + Change 'homogenous' arg from gint to gboolean. + + * gtk/gtktogglebutton.[ch]: + New function gtk_toggle_button_get_active(). + 1999-01-20 Federico Mena Quintero <federico@nuclecu.unam.mx> * gtk/gtkdnd.c (gtk_drag_get_event_action): Allow button 2 to act diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 63d8f8766f..48d68cf5e4 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +1999-01-20 Jeff Garzik <jgarzik@pobox.com> + + * gtk/gtkcombo.c (gtk_combo_entry_key_press): + Free 'nprefix', closing a memory leak. + Spaced out the code a bit to make it more readable. + + * gtk/gtkhbox.[ch] (gtk_hbox_new), + gtk/gtkvbox.[ch] (gtk_vbox_new): + Change 'homogenous' arg from gint to gboolean. + + * gtk/gtktogglebutton.[ch]: + New function gtk_toggle_button_get_active(). + 1999-01-20 Federico Mena Quintero <federico@nuclecu.unam.mx> * gtk/gtkdnd.c (gtk_drag_get_event_action): Allow button 2 to act diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 63d8f8766f..48d68cf5e4 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,16 @@ +1999-01-20 Jeff Garzik <jgarzik@pobox.com> + + * gtk/gtkcombo.c (gtk_combo_entry_key_press): + Free 'nprefix', closing a memory leak. + Spaced out the code a bit to make it more readable. + + * gtk/gtkhbox.[ch] (gtk_hbox_new), + gtk/gtkvbox.[ch] (gtk_vbox_new): + Change 'homogenous' arg from gint to gboolean. + + * gtk/gtktogglebutton.[ch]: + New function gtk_toggle_button_get_active(). + 1999-01-20 Federico Mena Quintero <federico@nuclecu.unam.mx> * gtk/gtkdnd.c (gtk_drag_get_event_action): Allow button 2 to act diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 63d8f8766f..48d68cf5e4 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,16 @@ +1999-01-20 Jeff Garzik <jgarzik@pobox.com> + + * gtk/gtkcombo.c (gtk_combo_entry_key_press): + Free 'nprefix', closing a memory leak. + Spaced out the code a bit to make it more readable. + + * gtk/gtkhbox.[ch] (gtk_hbox_new), + gtk/gtkvbox.[ch] (gtk_vbox_new): + Change 'homogenous' arg from gint to gboolean. + + * gtk/gtktogglebutton.[ch]: + New function gtk_toggle_button_get_active(). + 1999-01-20 Federico Mena Quintero <federico@nuclecu.unam.mx> * gtk/gtkdnd.c (gtk_drag_get_event_action): Allow button 2 to act diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 63d8f8766f..48d68cf5e4 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,16 @@ +1999-01-20 Jeff Garzik <jgarzik@pobox.com> + + * gtk/gtkcombo.c (gtk_combo_entry_key_press): + Free 'nprefix', closing a memory leak. + Spaced out the code a bit to make it more readable. + + * gtk/gtkhbox.[ch] (gtk_hbox_new), + gtk/gtkvbox.[ch] (gtk_vbox_new): + Change 'homogenous' arg from gint to gboolean. + + * gtk/gtktogglebutton.[ch]: + New function gtk_toggle_button_get_active(). + 1999-01-20 Federico Mena Quintero <federico@nuclecu.unam.mx> * gtk/gtkdnd.c (gtk_drag_get_event_action): Allow button 2 to act diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 63d8f8766f..48d68cf5e4 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,16 @@ +1999-01-20 Jeff Garzik <jgarzik@pobox.com> + + * gtk/gtkcombo.c (gtk_combo_entry_key_press): + Free 'nprefix', closing a memory leak. + Spaced out the code a bit to make it more readable. + + * gtk/gtkhbox.[ch] (gtk_hbox_new), + gtk/gtkvbox.[ch] (gtk_vbox_new): + Change 'homogenous' arg from gint to gboolean. + + * gtk/gtktogglebutton.[ch]: + New function gtk_toggle_button_get_active(). + 1999-01-20 Federico Mena Quintero <federico@nuclecu.unam.mx> * gtk/gtkdnd.c (gtk_drag_get_event_action): Allow button 2 to act diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c index 8d29d206f7..6857279e95 100644 --- a/gtk/gtkcombo.c +++ b/gtk/gtkcombo.c @@ -125,27 +125,37 @@ gtk_combo_entry_key_press (GtkEntry * entry, GdkEventKey * event, GtkCombo * com gchar* nprefix = NULL; gint pos; - if ( !GTK_LIST(combo->list)->children ) + if ( !GTK_LIST (combo->list)->children ) return FALSE; gtk_signal_emit_stop_by_name (GTK_OBJECT (entry), "key_press_event"); - cmpl = g_completion_new((GCompletionFunc)gtk_combo_func); - g_completion_add_items(cmpl, GTK_LIST(combo->list)->children); - pos = GTK_EDITABLE(entry)->current_pos; - prefix = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, pos); + + cmpl = g_completion_new ((GCompletionFunc)gtk_combo_func); + g_completion_add_items (cmpl, GTK_LIST (combo->list)->children); + + pos = GTK_EDITABLE (entry)->current_pos; + prefix = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, pos); + g_completion_complete(cmpl, prefix, &nprefix); - if (nprefix && strlen(nprefix) > strlen(prefix)) + + if (nprefix && strlen (nprefix) > strlen (prefix)) { - gtk_editable_insert_text(GTK_EDITABLE(entry), nprefix+pos, - strlen(nprefix)-strlen(prefix), &pos); - GTK_EDITABLE(entry)->current_pos = pos; + gtk_editable_insert_text (GTK_EDITABLE (entry), nprefix + pos, + strlen (nprefix) - strlen (prefix), &pos); + GTK_EDITABLE (entry)->current_pos = pos; } - g_free(prefix); - g_completion_free(cmpl); + + if (nprefix) + g_free (nprefix); + g_free (prefix); + g_completion_free (cmpl); + return TRUE; } + if (!combo->use_arrows || !GTK_LIST (combo->list)->children) return FALSE; + li = g_list_find (GTK_LIST (combo->list)->children, gtk_combo_find (combo)); if ((event->keyval == GDK_Up) diff --git a/gtk/gtkhbox.c b/gtk/gtkhbox.c index 0c10550b82..f705d9f563 100644 --- a/gtk/gtkhbox.c +++ b/gtk/gtkhbox.c @@ -69,7 +69,7 @@ gtk_hbox_init (GtkHBox *hbox) } GtkWidget* -gtk_hbox_new (gint homogeneous, +gtk_hbox_new (gboolean homogeneous, gint spacing) { GtkHBox *hbox; diff --git a/gtk/gtkhbox.h b/gtk/gtkhbox.h index 5a326133d7..0c34610579 100644 --- a/gtk/gtkhbox.h +++ b/gtk/gtkhbox.h @@ -51,7 +51,7 @@ struct _GtkHBoxClass GtkType gtk_hbox_get_type (void); -GtkWidget* gtk_hbox_new (gint homogeneous, +GtkWidget* gtk_hbox_new (gboolean homogeneous, gint spacing); diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c index 732526cce2..c5fbdb373d 100644 --- a/gtk/gtktogglebutton.c +++ b/gtk/gtktogglebutton.c @@ -267,6 +267,7 @@ gtk_toggle_button_set_mode (GtkToggleButton *toggle_button, } } + void gtk_toggle_button_set_active (GtkToggleButton *toggle_button, gboolean is_active) @@ -280,6 +281,17 @@ gtk_toggle_button_set_active (GtkToggleButton *toggle_button, gtk_button_clicked (GTK_BUTTON (toggle_button)); } + +gboolean +gtk_toggle_button_get_active (GtkToggleButton *toggle_button) +{ + g_return_val_if_fail (toggle_button != NULL, FALSE); + g_return_val_if_fail (GTK_IS_TOGGLE_BUTTON (toggle_button), FALSE); + + return (toggle_button->active) ? TRUE : FALSE; +} + + void gtk_toggle_button_toggled (GtkToggleButton *toggle_button) { diff --git a/gtk/gtktogglebutton.h b/gtk/gtktogglebutton.h index bdb2a6e697..156dfb7e3c 100644 --- a/gtk/gtktogglebutton.h +++ b/gtk/gtktogglebutton.h @@ -64,6 +64,7 @@ void gtk_toggle_button_set_mode (GtkToggleButton *toggle_button, gboolean draw_indicator); void gtk_toggle_button_set_active (GtkToggleButton *toggle_button, gboolean is_active); +gboolean gtk_toggle_button_get_active (GtkToggleButton *toggle_button); void gtk_toggle_button_toggled (GtkToggleButton *toggle_button); diff --git a/gtk/gtkvbox.c b/gtk/gtkvbox.c index cd48869cce..a4b8d031f9 100644 --- a/gtk/gtkvbox.c +++ b/gtk/gtkvbox.c @@ -69,7 +69,7 @@ gtk_vbox_init (GtkVBox *vbox) } GtkWidget* -gtk_vbox_new (gint homogeneous, +gtk_vbox_new (gboolean homogeneous, gint spacing) { GtkVBox *vbox; diff --git a/gtk/gtkvbox.h b/gtk/gtkvbox.h index ddebeadf92..2661df1baa 100644 --- a/gtk/gtkvbox.h +++ b/gtk/gtkvbox.h @@ -51,7 +51,7 @@ struct _GtkVBoxClass GtkType gtk_vbox_get_type (void); -GtkWidget* gtk_vbox_new (gint homogeneous, +GtkWidget* gtk_vbox_new (gboolean homogeneous, gint spacing); |