Skip to content

Commit 6c1bc34

Browse files
committed
mandelbrot-app.py get rid of deprecated Gtk thread functions
1 parent 10e055b commit 6c1bc34

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

software/mandelbrot-app.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,7 @@ def painter(self):
235235
self.pixels[pixel_index + 2] = blue
236236

237237
if pixel_count % (2 * self.width) == 0:
238-
Gdk.threads_enter()
239-
self.canvas.queue_draw()
240-
Gdk.threads_leave()
238+
GLib.idle_add(self.canvas.queue_draw)
241239

242240
pixel_queue.task_done()
243241

@@ -338,5 +336,4 @@ def onDraw(self, canvas: DrawingArea, cr: cairo.Context):
338336
window.connect("destroy", Gtk.main_quit)
339337
window.show_all()
340338

341-
Gdk.threads_init()
342339
Gtk.main()

0 commit comments

Comments
 (0)