summaryrefslogtreecommitdiff
path: root/gtk/gtkcombo.c
diff options
context:
space:
mode:
authorTim Janik <timj@gtk.org>1998-05-01 13:16:49 +0000
committerTim Janik <timj@src.gnome.org>1998-05-01 13:16:49 +0000
commitbefef270ab021a9fa690b822b937bdb3ce6aac31 (patch)
tree2e1618a66d41eca3586d0db082fe0036e3d9e6f1 /gtk/gtkcombo.c
parentce46df0b4bf5c9c5cc0d83e89e59d950c156b54c (diff)
downloadgtk+-befef270ab021a9fa690b822b937bdb3ce6aac31.tar.gz
prefixed all clist flags with GTK_ to avoid name clashes. redefined
Fri May 1 13:57:36 1998 Tim Janik <timj@gtk.org> * gtk/gtkclist.h: * gtk/gtkclist.c: prefixed all clist flags with GTK_ to avoid name clashes. redefined GTK_CLIST_SET_FLAGS and GTK_CLIST_UNSET_FLAGS as GTK_CLIST_SET_FLAG and GTK_CLIST_UNSET_FLAG to automatically add the GTK_ prefix (this solution involved less changes in the gtkclist.c code). added a GTK_CLIST_CONSTRUCTED flag to substitute the mem_chunk==NULL test in gtk_clist_construct. merged in changes from lars & stefan to support the derivation of GtkCtree. * gtkctree.h: * gtkctree.c: initial import of a tree widget derived from gtkclist, courtesy of Lars Hamann <lars@gtk.org> and Stefan Jeske <jeske@gtk.org>, it just damn rocks! Fri May 1 10:05:44 1998 Tim Janik <timj@gtk.org> * gtk/gtklist.c (gtk_list_add): let gtk_list_append_items do the work for us. (gtk_list_insert_items): (gtk_list_remove_items_internal): (gtk_list_clear_items): remove a possible pointer grab, we might get thrown into a loop otherwise. (gtk_list_button_press): grab the pointer *before* selecting the child, because selection of items may cause the lists children to change, resulting in a grab release. (gtk_list_clear_items): use gtk_list_unselect_child() for unselection of children. (gtk_list_shutdown): remove all children from the list. (gtk_real_list_unselect_child): (gtk_real_list_select_child): *always* put our internal structures into sane state *before* signal emisions (i.e. list->selection updates prior to gtk_list_item_[de]select() calls). * gtk/gtkcombo.c (gtk_combo_init): adjust the scrollbar if the lists focused child walks out of the window. removed CAN_FOCUS for the combo arrow's button since it doesn't react to keyboard events ("clicked" connection is missing).
Diffstat (limited to 'gtk/gtkcombo.c')
-rw-r--r--gtk/gtkcombo.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c
index 7ca02840c5..b8cfc4a5d9 100644
--- a/gtk/gtkcombo.c
+++ b/gtk/gtkcombo.c
@@ -112,6 +112,7 @@ static int
gtk_combo_entry_key_press (GtkEntry * entry, GdkEventKey * event, GtkCombo * combo)
{
GList *li;
+
/* completion? */
/*if ( event->keyval == GDK_Tab ) {
gtk_signal_emit_stop_by_name (GTK_OBJECT (entry), "key_press_event");
@@ -546,6 +547,7 @@ gtk_combo_init (GtkCombo * combo)
gtk_container_add (GTK_CONTAINER (combo->button), arrow);
gtk_box_pack_start (GTK_BOX (combo), combo->entry, TRUE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (combo), combo->button, FALSE, FALSE, 0);
+ GTK_WIDGET_UNSET_FLAGS (combo->button, GTK_CAN_FOCUS);
gtk_widget_show (combo->entry);
gtk_widget_show (combo->button);
combo->entry_change_id = gtk_signal_connect (GTK_OBJECT (combo->entry), "changed",
@@ -585,14 +587,18 @@ gtk_combo_init (GtkCombo * combo)
combo->popup = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (combo->popup),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ GTK_WIDGET_UNSET_FLAGS (GTK_SCROLLED_WINDOW (combo->popup)->hscrollbar, GTK_CAN_FOCUS);
+ GTK_WIDGET_UNSET_FLAGS (GTK_SCROLLED_WINDOW (combo->popup)->vscrollbar, GTK_CAN_FOCUS);
+ gtk_container_add (GTK_CONTAINER (frame), combo->popup);
+ gtk_widget_show (combo->popup);
combo->list = gtk_list_new ();
gtk_list_set_selection_mode(GTK_LIST(combo->list), GTK_SELECTION_BROWSE);
- gtk_container_add (GTK_CONTAINER (frame), combo->popup);
gtk_container_add (GTK_CONTAINER (combo->popup), combo->list);
+ gtk_container_set_focus_vadjustment (GTK_CONTAINER (combo->list),
+ gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (combo->popup)));
gtk_widget_show (combo->list);
- gtk_widget_show (combo->popup);
combo->list_change_id = gtk_signal_connect (GTK_OBJECT (combo->list), "selection_changed",
(GtkSignalFunc) gtk_combo_update_entry, combo);