From 2eff182a72ad6d42c361d617191c2b536bf336a9 Mon Sep 17 00:00:00 2001 From: Jared Wahlstrand Date: Sun, 10 Dec 2023 15:59:51 -0500 Subject: [PATCH] small fixes to new examples --- README.md | 2 +- examples/thread.jl | 6 +++--- examples/thread_timeout.jl | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d3566e1d..f241b6fc 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This package builds on Gtk.jl but uses GObject introspection to support more of Most of the code for GLib support (`GType`, `GValue`, `GObject`, etc.) was copied with minor changes from [Gtk.jl](https://github.com/JuliaGraphics/Gtk.jl). This includes integration of the GLib main loop with Julia's event loop. -Documentation for the master branch version of this package can be found [here](https://juliagtk.github.io/Gtk4.jl/dev/). Complete GTK documentation is available at [https://www.gtk.org/docs](https://www.gtk.org/docs). +Documentation for the master branch version of this package can be found [here](https://juliagtk.github.io/Gtk4.jl/dev/). Example code can be found [here](https://github.com/JuliaGtk/Gtk4.jl/tree/main/examples). Complete GTK documentation is available at [https://www.gtk.org/docs](https://www.gtk.org/docs). ## Package scope and alternatives diff --git a/examples/thread.jl b/examples/thread.jl index 3465d39a..6879f5a1 100644 --- a/examples/thread.jl +++ b/examples/thread.jl @@ -10,10 +10,10 @@ btn = GtkButton("Start") sp = GtkSpinner() ent = GtkEntry(;hexpand=true) -ltp = Threads.threadpool() - grid = GtkGrid() -grid[1:2,1] = GtkLabel("The GTK loop is running in thread $(Threads.threadid()) ($ltp threadpool)") +lab = GtkLabel("") +grid[1:2,1] = lab +@idle_add lab.label = "The GTK loop is running in thread $(Threads.threadid()) ($(Threads.threadpool()) threadpool)" grid[1,2] = btn grid[2,2] = sp grid[1:2,3] = ent diff --git a/examples/thread_timeout.jl b/examples/thread_timeout.jl index 3590daef..ed3de71f 100644 --- a/examples/thread_timeout.jl +++ b/examples/thread_timeout.jl @@ -11,10 +11,10 @@ sp = GtkSpinner() ent = GtkEntry(;hexpand=true) label = GtkLabel("") -ltp = Threads.threadpool() - grid = GtkGrid() -grid[1:2,1] = GtkLabel("The GTK loop is running in thread $(Threads.threadid()) ($ltp threadpool)") +lab = GtkLabel("") +grid[1:2,1] = lab +@idle_add lab.label = "The GTK loop is running in thread $(Threads.threadid()) ($(Threads.threadpool()) threadpool)" grid[1,2] = btn grid[2,2] = sp grid[1:2,3] = ent