From 1727c88c18101e6a24508e7b7155b874c0933644 Mon Sep 17 00:00:00 2001 From: markochk <36880601+markochk@users.noreply.github.com> Date: Thu, 24 Feb 2022 19:05:13 +0100 Subject: [PATCH] Replace dw with self.dw in Cairo introduction because self.dw is needed in the following section --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 45a589d..a570089 100644 --- a/README.md +++ b/README.md @@ -414,18 +414,18 @@ To draw with Cairo we use the [***DrawingArea***](https://docs.gtk.org/gtk4/clas ```python - dw = Gtk.DrawingArea() + self.dw = Gtk.DrawingArea() # Make it fill the available space (It will stretch with the window) - dw.set_hexpand(True) - dw.set_vexpand(True) + self.dw.set_hexpand(True) + self.dw.set_vexpand(True) # Instead, If we didn't want it to fill the available space but wanted a fixed size - #dw.set_content_width(100) - #dw.set_content_height(100) + #self.dw.set_content_width(100) + #self.dw.set_content_height(100) - dw.set_draw_func(self.draw, None) - self.box3.append(dw) + self.dw.set_draw_func(self.draw, None) + self.box3.append(self.dw) def draw(self, area, c, w, h, data): # c is a Cairo context