Tix Combo box problem - remains in editable mode only

dudeja.rajat at gmail.com dudeja.rajat at gmail.com
Tue Sep 30 14:09:25 CEST 2008


On Tue, Sep 30, 2008 at 11:57 AM, <dudeja.rajat at gmail.com> wrote:

> Hi
>
> I'm facing a problem with the tix combo box in a way that my combo box is
> always in an editable mode after I have cleared subwidgets Entry and Listbox
> from it.
>
>
> My setup is like this :
>
> CheckButton1 :
>
> If this is unset, the combo box should get disabled, the entries in it
> should get cleared ( entries are listbox and entry subwidgets) which in my
> case they get cleared.
>
> When this check box is set again, the combo box should get enabled, with no
> entries in listbox and entry subwidgets ( which are reallly cleared in my
> case.) But the combox box having being enabled is in editable mode despite
> of setting it to un-editable mode.
>
>
> The code is as follows:
> #Combo Box
> self.cbAnalysisLibVersion = Tix.ComboBox(self.frame1, \
>                                                  dropdown = True, \
>
> command=self.__cllbkAnalysisLibVer, \
>                                                  editable=0, \
>                                                  variable=verSelection,
>                                                  options='listbox.height 8\
>                                                  listbox.width 25 \
>                                                  entry.width 30 \
>                                                  entry.anchor w \
>                                                  entry.padx 30', \
>                                                  history = False)
>
>
> #Check Button box
> self.chBtResultsComparison = Checkbutton(self.frame2, \
>                                                text = "Results Comparison",
> \
>                                                variable =
> varResultsComparison, \
>                                                command =
> self.__cllbkResultsComparison)
>
> def __cllbkResultsComparison(self, Event = None):
>
>     subLB = self.cbAnalysisLibVersion.subwidget("listbox")
>     subEntry = self.cbAnalysisLibVersion.subwidget("entry")
>
>     if varResultsComparison.get() != 1:
>         #Disable Tolerance Text Box
>
>         self.txtTolerance.delete(1.0, END)
>         self.txtTolerance.config(state = DISABLED, \
>                                      bg = "grey")
>         #Delete all entries (entry & subwidget's entries)
>         #in Reference Analysis Results Version Combo Box
>         #and disable this combo box.
>
>         #First Delete the Listbox sub-widget entries
>         subLB.delete(0, END)
>         subLB.config(state = DISABLED)
>
>         #Then delete Entry sub-widget entries
>         #subEntry = self.cbAnalysisLibVersion.subwidget("entry")
>         subEntry.config(state = NORMAL)
>         subEntry.delete(0, END)
>         subEntry.config(state = DISABLED)
>
>         self.cbAnalysisLibVersion.config(state = DISABLED)
>         #Diable Result Comparison Button
>         self.btViewComparisonResults.config(state = DISABLED)
>
>     else:
>         #Check box is ticked
>         #Enable the Tolerance text box
>         self.txtTolerance.config(state = NORMAL, \
>                                      bg = "white")
>         #Enable the Reference Analysis Combo box
>         #self.cbAnalysisLibVersion.config(state = NORMAL, editable=0)
>         self.cbAnalysisLibVersion.configure(state = NORMAL, editable = 0)
>         subLB.config(state = NORMAL)
>         subEntry.config(state = NORMAL)
>
>         self.btViewComparisonResults.config(state = NORMAL)
>
>
> Please suggest what is that I am missing
>
> Regards,
> Rajat
>

Any help guys?

-- 
Regrads,
Rajat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080930/81167fde/attachment.html>


More information about the Python-list mailing list