I'm trying to make a list where a row has some data that can be represented as text, where the row is selectable, and can contain a progressbar. I can't figure out how to implement this with tkinter, I can set up a selectable list with a treeview element, and a progressbar with the progressbar element. But I can't put them together. While I'm using tkinter right now, I'm open to other packages that would support this. Here's the layout I've been working off of http://i.imgur.com/x9cv29j.png
Related
i am using python 3, GUI, tkinter.
i use grid method (row and column) to create a table containing info, a button is placed in the end of each row. if someone press that button, the whole row will disappear/destroy and next row will replace it, which function should i use to achieve that?
The grid_forget() method will cause the grid geometry manager to stop managing a widget. So if you put your widgets for a row into a frame and grid that, you can grid_forget the frame to have all the widgets in the frame removed from display together. However, you might want to investigate the Ttk treeview which can display tabular information or the tktable package (see this answer).
I have a listbox, and I would like to have a progress bar inside each line of this listbox. Is there a simple way to do that, or do I have to rewrite the listbox class, or maybe override it ?
There is no simple way. A listbox can only contain text.
You can fake it fairly easily with a text widget, since a text widget allows you to embed widgets. For each row you could insert the text, insert a progress bar, and then insert a newline.
I have a tkinter GUI that, when opened, is an empty widget with a menu bar on top. Clicking on the options on the menu causes for text boxes, more buttons and more menus to appear in the widget. My problem is that everything overlaps.
I need an easy way to delete everything that is currently there, like a "clear window" option.
I've tried packing everything into a frame and then destroying a frame but, for some reason, it's not working.
Any suggestions?
Ideally, I would make something that checks to see if there is anything (button, text box, menu) in a designated space, and it would delete it all before creating the new widget attributes.
The Problem I was having was fixed by creating a new frame within each function and having the code destroy any previously existing frames with Frame.destroy().
My second problem, where widgets within my frame were not, appearing was being caused by how Tkinter frames automatically resize to fit the original widgets. Therefore, when I added widgets to the frame, the frame remained the size of the first widget and didn't show the new buttons. I used frame.pack_propagate(0) to force the frame to remain the specified size.
I know how to create a Listbox using Tkinter but this only allows me to display a list of single items. I need to create a expandable list that allows the user to hit something along the lines of a + next to the item which in turn opens up a new list with + buttons next to each item until you reach the leaf of a list. I was wondering if there was a way to implement this type of expandable list using Tkinter or if not if there was a different Python GUI tool that could do so?
The widget you are looking for is commonly called a "tree" or "hierarchical tree".
If you're using python2.7 or greater you can use ttk.Treeview widget.
For older versions of python you can use Tix.Tree. You can also search for "tkinter tree" on google and you'll find several other variations such as this one.
On a click of a button named "Add Textbox" it calls a function which creates a single textbox using (gtk.Entry) function. So each time i click that button it creates a textbox. I have a submit button which should fetches all the values of the text boxes(say 10 textboxes) generated with the name of "entry". It works for one textbox but not for multiple. In php we can create dynamix textboxes mentioning as an array name=entry[]. Do we have similar functionality in python ?
Enviroment : FC10 , Glade 3 , Python 2.5 , GTK.
You could be a bit clearer, it's not obvious what you do with your GtkEntry after creating it. The easiest thing would be to just add it to a Python list, so you can iterate over all created GtkEntry widgets later.
Or, you could "tag" the widgets with something to make them identifiable, and iterate over the containing widgets (assuming you really do add the widget to a window or something).