From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9272 invoked by alias); 25 Sep 2002 03:16:24 -0000 Mailing-List: contact insight-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sources.redhat.com Received: (qmail 9265 invoked from network); 25 Sep 2002 03:16:23 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 25 Sep 2002 03:16:23 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g8P2wUi06017 for ; Tue, 24 Sep 2002 22:58:30 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g8P3GMf11223; Tue, 24 Sep 2002 23:16:23 -0400 Received: from redhat.com (vpn50-22.rdu.redhat.com [172.16.50.22]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g8P3GMJ08099; Tue, 24 Sep 2002 23:16:22 -0400 Message-ID: <3D912A47.5060302@redhat.com> Date: Tue, 24 Sep 2002 20:16:00 -0000 From: "Martin M. Hunt" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Fernando Nasser CC: insight@sources.redhat.com Subject: Re: Modal Dialogs lose grab when comboboxes are used References: <3D88E72F.3040406@redhat.com> <3D88F595.1040902@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-q3/txt/msg00189.txt.bz2 Fernando, Did you forget something? This breaks all the comboboxes on Insight. Looks like grabstatus is not initialized. Doing that gets things working for me, but I did not look very closely. Index: combobox.tcl =================================================================== RCS file: /cvs/src/src/libgui/library/combobox.tcl,v retrieving revision 1.4 diff -u -u -r1.4 combobox.tcl --- combobox.tcl 20 Sep 2002 17:38:52 -0000 1.4 +++ combobox.tcl 25 Sep 2002 03:11:01 -0000 @@ -107,7 +107,7 @@ variable oldValue variable ignoreTrace variable grablist - variable grabstatus + variable grabstatus "" variable this array set widgets {} Martin Fernando Nasser wrote: > Martin, > > Here is a more complete version of the fix. > > I was not keeping track if the old grabs were local or global. > > Regards, > Fernando > > > > ------------------------------------------------------------------------ > > Index: library/combobox.tcl > =================================================================== > RCS file: /cvs/src/src/libgui/library/combobox.tcl,v > retrieving revision 1.2 > diff -c -p -r1.2 combobox.tcl > *** library/combobox.tcl 8 Sep 2001 22:34:46 -0000 1.2 > --- library/combobox.tcl 18 Sep 2002 21:49:20 -0000 > *************** proc ::combobox::build {w args } { > *** 106,111 **** > --- 106,113 ---- > variable options > variable oldValue > variable ignoreTrace > + variable grablist > + variable grabstatus > variable this > > array set widgets {} > *************** proc ::combobox::doInternalWidgetCommand > *** 677,682 **** > --- 679,686 ---- > proc ::combobox::widgetProc {w command args} { > upvar ::combobox::${w}::widgets widgets > upvar ::combobox::${w}::options options > + upvar ::combobox::${w}::grablist grablist > + upvar ::combobox::${w}::grabstatus grabstatus > > # this is just shorthand notation... > set doWidgetCommand \ > *************** proc ::combobox::widgetProc {w command a > *** 787,792 **** > --- 791,800 ---- > > # *gasp* do a global grab!!! Mom always told not to > # do things like this... :-) > + set grablist [grab current] > + foreach grabitem $grablist { > + lappend grabstatus [grab status $grabitem] > + } > grab -global $widgets(this) > > # fake the listbox into thinking it has focus > *************** proc ::combobox::widgetProc {w command a > *** 802,807 **** > --- 810,824 ---- > } > # hides the listbox > grab release $widgets(this) > + foreach grabitem $grablist itemstatus $grabstatus { > + if {$itemstatus == "global"} { > + grab set -global $grabitem > + } else { > + grab set $grabitem > + } > + } > + set grablist {} > + set grabstatus {} > $widgets(button) configure -relief raised > wm withdraw $widgets(popup) >