Webrsk
Webrsk

Reputation: 1026

pygtk - dynamically update the widgets taking input from the gtk combo box

On selecting value from 1 to 10 from gtk combox box it should populate the checkbox by taking combo box value as an input. Say for example if i select 5 then 5 checkbox will be generated. It works.. But the issue is after i selected 5 now im selecting next value as 3 from combo box then there 8 checkboxes are displayed. The old 5 checkbox didnt get replaced. Is there any way to refresh the vbox(which has the checkboxes) or update to a new value.

Enviroment : FC10 , Glade 2 , Python 2.5 , GTK.

Upvotes: 0

Views: 1681

Answers (1)

Isaiah
Isaiah

Reputation: 4309

Add this to your code right before you add your comboboxes:

for widget in myVBox.get_children():
    myVBox.remove(widget)

Upvotes: 2

Related Questions