2

I am trying to make a multiple rows in a treeview in Python 3 using GTK3+. In each row you will have multiple buttons and Toggleswitches and so on. It will be something as shown below. I've tried to find examples but never succeded to find anything that satisfies my needs.

enter image description here

Each time you click on + button a new similar row should appear and be added. And every buttons 1-4 should do different things. For instance in row 1 we try to download a file by clicking Button 4 (the one to the right- sorry misspelled in the picture). This should not interfear with other Button 4s in other rows.

So the main question is how I make such row using GTK. and How do I generate similar rows in the tree view. I would appriciate any links that deal with buttons in treeviews or images in treeviews.

Payam30
  • 689
  • 1
  • 5
  • 20

1 Answers1

2

You should use a GtkListBox. Here's an example.

theGtknerd
  • 3,647
  • 1
  • 13
  • 34
  • Thank you for you respons. Do you mean that i should make a new class with that code? How would the plus button 'add a new row' get the row from? From that class? – Payam30 Jan 12 '19 at 22:24
  • You can use a class, but you don't need to. You can just create a new ListBoxRow object and add it to the Listbox. – theGtknerd Jan 13 '19 at 03:34