GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit 560f646c authored by Jon K Hellan's avatar Jon K Hellan Committed by Jon Kåre Hellan

Silence run-time warning: Check for non-null list item from hash before

2000-06-08  Jon K Hellan  <hellan@acm.org>

	* gtk-combo-text.c (gtk_combo_text_set_text): Silence run-time
	warning: Check for non-null list item from hash before casting to
	widget.
parent 87f72c55
2000-06-08 Jon K Hellan <hellan@acm.org>
* gtk-combo-text.c (gtk_combo_text_set_text): Silence run-time
warning: Check for non-null list item from hash before casting to
widget.
* gtk-combo-text.[ch] (gtk_combo_text_set_text): New function. Set
displayed text, and select it in the list if present.
......
......@@ -111,6 +111,7 @@ gtk_combo_text_select_item (GtkComboText *ct, int elem)
void
gtk_combo_text_set_text (GtkComboText *ct, const gchar *text)
{
gpointer candidate;
GtkWidget *child;
gtk_entry_set_text (GTK_ENTRY (ct->entry), text);
......@@ -123,9 +124,9 @@ gtk_combo_text_set_text (GtkComboText *ct, const gchar *text)
(gpointer) ct);
gtk_list_unselect_all (GTK_LIST (ct->list));
child = GTK_WIDGET (g_hash_table_lookup (ct->elements,
(gconstpointer) text));
if (child && GTK_IS_WIDGET (child)) {
candidate = g_hash_table_lookup (ct->elements, (gconstpointer) text);
if (candidate && GTK_IS_WIDGET (candidate)) {
child = GTK_WIDGET (candidate);
gtk_list_select_child (GTK_LIST (ct->list), child);
gtk_widget_grab_focus (child);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment