Replace dw with self.dw in Cairo introduction because self.dw is needed in the following section

This commit is contained in:
markochk
2022-02-24 19:05:13 +01:00
parent f130a1f948
commit 1727c88c18

View File

@@ -414,18 +414,18 @@ To draw with Cairo we use the [***DrawingArea***](https://docs.gtk.org/gtk4/clas
```python ```python
dw = Gtk.DrawingArea() self.dw = Gtk.DrawingArea()
# Make it fill the available space (It will stretch with the window) # Make it fill the available space (It will stretch with the window)
dw.set_hexpand(True) self.dw.set_hexpand(True)
dw.set_vexpand(True) self.dw.set_vexpand(True)
# Instead, If we didn't want it to fill the available space but wanted a fixed size # Instead, If we didn't want it to fill the available space but wanted a fixed size
#dw.set_content_width(100) #self.dw.set_content_width(100)
#dw.set_content_height(100) #self.dw.set_content_height(100)
dw.set_draw_func(self.draw, None) self.dw.set_draw_func(self.draw, None)
self.box3.append(dw) self.box3.append(self.dw)
def draw(self, area, c, w, h, data): def draw(self, area, c, w, h, data):
# c is a Cairo context # c is a Cairo context