You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a stateful action with `name`, a parameter of type `T`, and an initial state to a `GActionMap`. Also connect a `handler` for the action's "change-state" signal.
Set a GObject property `name` (which can be a string or symbol) to `value` converted to type `T`.
301
+
"""
282
302
set_gtk_property!(w::GObject, name, ::Type{T}, value) where T =set_gtk_property!(w, name, convert(T, value))
303
+
304
+
"""
305
+
set_gtk_property!(w::GObject, name, value)
306
+
307
+
Set a GObject property `name` (which can be a string or symbol) to `value`. The type of `value` will be converted to match the property type, if possible.
308
+
309
+
GObject properties are mapped onto Julia instance properties, so note that this function is equivalent to the more convenient syntax `w.name = value`.
Copy file name to clipboardexpand all lines: src/GLib/loop.jl
+4-3
Original file line number
Diff line number
Diff line change
@@ -155,13 +155,14 @@ end
155
155
"""
156
156
pause_main_loop(f)
157
157
158
-
Pauses the GLib eventloop around a function. Restores the original state of the eventloop after
159
-
calling the function.
158
+
Pauses the GLib event loop around a function. Restores the original state of the event loop after calling the function. This function does not pause the event loop if it is being run by a `GApplication`.
160
159
"""
161
160
functionpause_main_loop(f)
162
161
was_running =is_loop_running()
163
162
if was_running && g_main_running[] ==false
164
-
error("Main loop is running, but not via `glib_main`. Pausing the main loop inside a GApplication is not currently supported.")
163
+
warn("GLib main loop is running, but not via `glib_main`. Pausing the main loop inside a GApplication is not currently supported, so the function will be called without pausing.")
signal_emit(w::GObject, sig::AbstractStringLike, ::Type{RT}, args...) where RT
164
+
165
+
Cause an object signal to be emitted. The return type `RT` and the correct number of arguments (of the correct type) must be provided. The argument list should exclude the `user_data` argument.
166
+
"""
162
167
functionsignal_emit(w::GObject, sig::AbstractStringLike, ::Type{RT}, args...) where RT
163
168
i =isa(sig, AbstractString) ?something(findfirst("::", sig), 0:-1) : (0:-1)
164
169
if!isempty(i)
@@ -422,7 +427,7 @@ end
422
427
423
428
Connect a callback `f` to the object's "notify::property" signal that will be
424
429
called whenever the property changes. The callback signature should be
425
-
`f(::Ptr, param::Ptr{GParamSpec}, user_data)` and should return `nothing`.
430
+
`f(::Ptr, param::Ptr{GParamSpec}, user_data)` and the function should return `nothing`.
426
431
"""
427
432
functionon_notify(f, object::GObject, property::AbstractString, user_data = object, after =false)
0 commit comments