472,374 Members | 1,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 software developers and data experts.

Re: How to delete elements from Tix Combo Box?

On Sat, Aug 30, 2008 at 2:32 PM, Fredrik Lundh <fr*****@pythonware.comwrote:
du**********@gmail.com wrote:
>I'm using a Tix combo box (I call it combo2), the contents of which
are loaded depeding on the selection in another Tix combo box(I call
it combo1)
I have used the commands:

self.cbAnalysisLibVersion.insert(END, results)

to insert elements to the combo box.

I'm looking for some similar option to delete elements from the combo
box. I mean, as soon as I change selection in
combo1 the previous elements in the combo2 should get cleared up( or
deleted) and | shall be able to the above insert command to add new
elements to the combo2 ( depending upon selection in combo1)

Please suggest how can I clear up the ( delete the entries) in combo2.

no time to test this, but iirc, the combobox content is held in an ordinary
listbox widget, so you should be able to use the subwidget method to fetch
that widget, and then use ordinary listbox methods to change the content.
Something like this:

lb = w.subwidget("listbox")
lb.delete(0, END) # delete all items


Fredrik, Thanks so much. That worked.

Following this, I can now see that my combo2 has no previous elements
and contains only the elements relevant to selection in combo1.

Now, as soon as I select something in combo 2 and go back to change
selection in combo1 the combo2 must get its history cleared up (i.e
the previous selection in combo2's entry subwidget)

I used the command before I delete the entires :
self.combo2.config(history = False)

But this does not seem to be working;

Here is my code snippet:
Inside the callback function of combo1:

for libName, libResults in self.__libVerDict.items():
if libName == selectedLibName:
#Get the list of labelled results
resultsVer = self.__libVerDict[libName]
self.combo2.config(state = NORMAL)
self.combo2.config(history = False)
#Delete the previous entries from the listbox
#subwidget of combo box
subLB = self.combo2.subwidget("listbox")
subLB.delete(0, END)
#Add the results to the combo box
for results in resultsVer:
self.combo2.insert(END, results)
Aug 30 '08 #1
0 1509

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Timothy Madden | last post by:
Hello I have a linked list of object of a class. I thought it would be nice to have the destructor delete the whole list when I delete just the first element. I don't want to recursivly destroy...
by: SAN CAZIANO | last post by:
how can clear an html SELECT and next insert in it all the elements of an array () I try this but seems doesn't works. function ComboAddArrayValueWithLabel(combo,ArrayLabel,ArrayValue) { ...
by: Tony Williams | last post by:
I have a database with three tables as follows Table 1=Documents Table 2= Groups On a form based on Table 1 is a continuous subfrom that has a combo box based on Table 2 When the user makes a...
by: Chuckles | last post by:
Hi all, I have two unbound combo boxes on a form that I wuould like to use to delete a record from a table. The two combo boxes find data from two other tables through queries. When clicking on a...
by: jasone | last post by:
Hi, A section of my database allows users to delete items from a table, there is only one collumn in the table, this contains module information(parts of a manufacturing line) due to the lines...
by: y2ktan | last post by:
Hi Guys and Girls, I am building a windows application using VS2005, C#.net. Now, I have a combo box that contains a collection of elements. Thus, I want to grey out some of the elements in the...
by: dudeja.rajat | last post by:
HI, I'm using a Tix combo box (I call it combo2), the contents of which are loaded depeding on the selection in another Tix combo box(I call it combo1) I have used the commands: ...
by: Fredrik Lundh | last post by:
dudeja.rajat@gmail.com wrote: no time to test this, but iirc, the combobox content is held in an ordinary listbox widget, so you should be able to use the subwidget method to fetch that...
by: premMS143 | last post by:
Hi Everybody, I'm using VB to create a stand alone application. I want to delete some data item from Combo box & List Box. I've done this. When I try to delete any data item from the combo or...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.