Tkinter - Scrollable list with images and editable text - python

Using Tkinter I want to create a scrollable list(rows and columns) with images and editable text. The first column should contain images and the second column should contain tags(text) for the respective images in the previous column.
Hence a row should contain an image in a column and text in the next column.
Please let me know, what widget i need to use in Tkinter in order to achieve this.
Thanks for any help.

I would use a single frame for the images and editable text. You can use a text widget for the editable text, and align them using grid.
Then, place the frame in a canvas so that it can be scrolled. There are many questions and answers on this site related to scrolling a frame. See, for example, this answer: https://stackoverflow.com/a/16198198/7432

Related

QTableView - how to highlight only text with color (not entire cell)

I would like to for some of the columns in my QTableView give color highlight to the text without filling the rest of the cell with color. This image shows exactly what I want:
What is the best way to do this? One option is to create each text value as an image externally and then set it as an icon (I know how to do that from other SO posts). But is there a better way?
I will do this for quite many tables / columns with many different values so I would need to create many images if I use icons. So it would be great if there is a way to instead write the text in the QTableView and somehow apply the color background so that it covers the text only.
Is it possible to e.g. paint that background using an item delegate somehow? Has someone done something similar with item delegates before and that can share an example of how it's done? I'm very new to Qt.
I'm using PyQt6.

Tkinter Treeview - Conditional Formatting - Individual cell colours

I'm currently using Tkinter's Treeview to display a table of data in my GUI, and would like to apply conditional formatting in the Treeview widget so that the background colour of a cell depends on that cell's value (e.g. 0 would be red, and 1-6 are green). Very much like Excel's conditional formatting.
My program reads a CSV file and converts it to a Pandas DataFrame, and I use the Treeview widget to display that data. I also have buttons in my GUI that lets the user filter the data depending on which button is clicked.
I haven't been able to find or think of an easy solution. Would anyone know of a possible work-around or an alternative please?
Desired example output

How do I force an object to overlap in PySide?

I'm trying to create a search feature in my pyside program that shows results based on a user input. Currently, I have a QLineEdit setup for the user to make an entry. When the user enters a match, the results should appear in the QLineEdit as it will expand. The program is divided into two frames: A top frame (where the search bar is located) and a content frame which shows the raw content.
My issue is that when I am trying to expand the QLineEdit, it doesn't allow itself to overlap into the content frame and becomes hidden. Here's an image of what I would like to happen.
Before:
After:
I understand that I have horizontal policies setup on both frames with a "No-frame" frame shape, would this have an impact on the output?

Add border to table in pygtk

I am trying to use gtk table in one of my projects(GUI based) to show a pair of columns and its values. Since gtk table doesn't have borders by default, my GUI is not coming up well.
So,
Is there anyway I can add borders to gtk table and its cells?
If no can I create a customized widget with borders by extending gtk Table?
How can I create a customized widget in pygtk?
P.S: I have tried gtk Treeview and gtk Frames and thats not what I want. Also I have created a gtk treeview for each pair of columns and its values but the GUI works very very slow.
Assuming you want five pixels of spacing, if you would like to have space between the different cells of your table, you can try table.set_row_spacings(5); table.set_col_spacings(5); If you would like to have space around the entire table, you can do table.set_padding(5).

Make width of various widgets correspond with treeview columns

As an example, I have an entry, and several optionmenus located below a treeview widget. I am using the grid manager, and the treeview has a columnspan equal to all the widgets along it's lower side.
Since specifying the width of an entry or an optionmenu is in characters (the width in px of those characters is in turn based on the font size/family chosen for the widgets), and specifying the width of a column in a treeview is in pixels, how can I calculate the lengths of both a column and the widget underneath it so that they are visually linked by their positions (the length being the same)?
I found a great example of treeview. It might help to provide some insight. Here is the link
Create a table using treeview with control of column widths

Categories

Resources