widget

tkinter listbox get(ACTIVE) method

tkinter listbox get(ACTIVE) method Question: I was trying to make the currently selected Listbox item to be printed out. For example, when I select item "one", it should print out "one" and when I select item "two", it should print out "two" etc. The following is what I have tried. from Tkinter import* root=Tk() sizex …

Total answers: 5

pyqt: how to remove a widget?

pyqt: how to remove a widget? Question: I have a QGroupBox widget with children in it that I want to remove. How do I do that? I can’t find any removeWidget, removeChild, removeItem, or anything similar in the docs. I can only see how to remove things from a layout, but that, apparently, doesn’t remove …

Total answers: 2

How to detect when an OptionMenu or Checkbutton change?

How to detect when an OptionMenu or Checkbutton change? Question: My tkinter application has several controls, and I’d like to know when any changes occur to them so that I can update other parts of the application. Is there anything that I can do short of writing an updater function, and looping at the end …

Total answers: 4

How to clear the Entry widget after a button is pressed in Tkinter?

How to clear the Entry widget after a button is pressed in Tkinter? Question: I’m trying to clear the Entry widget after the user presses a button using Tkinter. I tried using ent.delete(0, END), but I got an error saying that strings don’t have the attribute delete. Here is my code, where I’m getting error …

Total answers: 13

Django required field in model form

Django required field in model form Question: I have a form where a couple of fields are coming out as required when I don’t want them too. Here is the form from models.py class CircuitForm(ModelForm): class Meta: model = Circuit exclude = (‘lastPaged’,) def __init__(self, *args, **kwargs): super(CircuitForm, self).__init__(*args, **kwargs) self.fields[‘begin’].widget = widgets.AdminSplitDateTime() self.fields[‘end’].widget = …

Total answers: 6

Which GTK widget combination to use for scrollable column of widgets?

Which GTK widget combination to use for scrollable column of widgets? Question: I’m working with PyGTK, trying to come up with a combination of widgets that will do the following: Let me add an endless number of widgets in a column Provide a vertical scrollbar to get to the ones that run off the bottom …

Total answers: 3