mirror of
https://github.com/Taiko2k/GTK4PythonTutorial.git
synced 2026-01-06 19:30:10 +01:00
Update README.md
This commit is contained in:
@@ -761,9 +761,10 @@ First we can create an object that will hold the data we want for each item in t
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
class Fruit(GObject.Object):
|
class Fruit(GObject.Object):
|
||||||
name = GObject.Property(type=str, default="")
|
name = GObject.Property(type=str)
|
||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
self.name = name
|
||||||
```
|
```
|
||||||
|
|
||||||
Then we create each object and put them in a ListStore. Then from that ListStore we create a SelectionModel, in this case im using a *SingleSelection*.
|
Then we create each object and put them in a ListStore. Then from that ListStore we create a SelectionModel, in this case im using a *SingleSelection*.
|
||||||
|
|||||||
Reference in New Issue
Block a user