473,385 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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

</F>

--
http://mail.python.org/mailman/listinfo/python-list
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)
--
Regards,
Rajat
Aug 30 '08 #1
0 1570

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

Similar topics

14
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...
1
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) { ...
0
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...
4
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...
2
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...
2
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...
0
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: ...
0
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...
13
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.