From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7585 invoked by alias); 4 Feb 2002 22:08:59 -0000 Mailing-List: contact sourcenav-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sourcenav-owner@sources.redhat.com Received: (qmail 7523 invoked from network); 4 Feb 2002 22:08:58 -0000 Received: from unknown (HELO mail-out1.apple.com) (17.254.0.52) by sources.redhat.com with SMTP; 4 Feb 2002 22:08:58 -0000 Received: from mailgate1.apple.com (A17-128-100-225.apple.com [17.128.100.225]) by mail-out1.apple.com (8.11.3/8.11.3) with ESMTP id g14M8vQ03571 for ; Mon, 4 Feb 2002 14:08:57 -0800 (PST) Received: from scv1.apple.com (scv1.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.2.1) with ESMTP id ; Mon, 4 Feb 2002 14:08:36 -0800 Received: from saxophone (saxophone.apple.com [17.202.41.155]) by scv1.apple.com (8.11.3/8.11.3) with ESMTP id g14M8uZ20410; Mon, 4 Feb 2002 14:08:56 -0800 (PST) Date: Tue, 05 Feb 2002 08:07:00 -0000 Subject: Re: [Patch] Fix -readonly option in combo.tcl Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v480) Cc: sourcenav To: Mo DeJong From: Syd Polk In-Reply-To: <20020204132417.63049782.supermo@bayarea.net> Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.480) X-SW-Source: 2002-q1/txt/msg00057.txt.bz2 This looks reasonable. On Monday, February 4, 2002, at 01:24 , Mo DeJong wrote: > Here is a small patch that fixes the combo class so that it works > with a stock Tk 8.3. The previous version depended on some local changes > that are not available in the stock Tk 8.3 and are not in the Tk > version on sources. > > Since this is a small change I assume it will be covered by the > "Small changes can be accepted without a copyright > assignment form on file" text from the contrib webpage. > > Mo > > 2002-02-04 Mo DeJong > > * gui/combo.tcl (-state, -readonly): Implement a read > only entry widget with a binding that ignores all > key press events. The previous implementation depended > on a local modification that added a -state readonly > property to the entry widget. We can't depend on that > modification since it will not exist in a system > install of Tk 8.3. > * tests/gui/combo.test: Add test case for selecttext > member function. > > --- gui/combo.tcl Mon Feb 26 09:15:15 2001 > +++ gui/combo.tcl Mon Feb 4 00:20:51 2002 > @@ -391,8 +391,9 @@ > # as a keep option to the widgets since > # we need to configure the entry and > # keep track of the -readonly option. > - # We also only want to support to > - # -state options, normal and disabled. > + # The -state readonly is also not available > + # in Tk 8.3, it only supports normal > + # and disabled. > > itk_option define -state state State normal { > if {$itk_option(-state) != "normal" && > @@ -406,22 +407,23 @@ > if {$itk_option(-state) == "disabled"} { > $itk_component(entry) configure -state disabled > } else { > + $itk_component(entry) configure -state normal > + > if {$itk_option(-readonly)} { > - $itk_component(entry) configure -state readonly > + bind $itk_component(entry) break > } else { > - $itk_component(entry) configure -state normal > + bind $itk_component(entry) {} > } > } > } > > itk_option define -readonly readOnly ReadOnly 0 { > if {$itk_option(-readonly)} { > - if {$itk_option(-state) == "normal"} { > - $itk_component(entry) configure -state readonly > + if {[string equal $itk_option(-state) "normal"]} { > + bind $itk_component(entry) break > } > } else { > - $itk_component(entry) configure -state \ > - $itk_option(-state) > + bind $itk_component(entry) {} > } > } > > >