From 9133d9cbc3ae013e92380534408cfd84fa7a7f9d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 12 Sep 2013 18:36:24 -0600 Subject: [PATCH] racket/gui gtk: drop initial selection of list-box item Make behavior on Gtk more consistent with other platforms. original commit: 2ea55efeec603d6b0a0c74a745ed39791f46c43a --- pkgs/gui-pkgs/gui-lib/mred/private/wx/gtk/list-box.rkt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/gui-pkgs/gui-lib/mred/private/wx/gtk/list-box.rkt b/pkgs/gui-pkgs/gui-lib/mred/private/wx/gtk/list-box.rkt index daf2179b..2b0f1043 100644 --- a/pkgs/gui-pkgs/gui-lib/mred/private/wx/gtk/list-box.rkt +++ b/pkgs/gui-pkgs/gui-lib/mred/private/wx/gtk/list-box.rkt @@ -137,9 +137,12 @@ (maybe-init-select)) (define/private (maybe-init-select) - (when (and (= (get-selection) -1) - (pair? data)) - (set-selection 0))) + ;; For consistency with other platforms, + ;; don't try to select an item initially. + (when #f + (when (and (= (get-selection) -1) + (pair? data)) + (set-selection 0)))) (define gtk (as-gtk-allocation (gtk_scrolled_window_new #f #f))) (gtk_scrolled_window_set_policy gtk GTK_POLICY_AUTOMATIC GTK_POLICY_ALWAYS)