Skip to content

Commit 7a9d15a

Browse files
authored
allow Gtk4 v0.7 (#20)
1 parent c61ae8c commit 7a9d15a

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
julia-version:
18-
#- "1.6"
1918
- "1"
2019
#- "nightly"
2120
os:
@@ -45,11 +44,3 @@ jobs:
4544
- uses: julia-actions/julia-runtest@latest
4645
with:
4746
prefix: ${{ matrix.prefix }}
48-
- uses: julia-actions/julia-processcoverage@latest
49-
if: startsWith(matrix.os, 'ubuntu')
50-
with:
51-
directories: src
52-
- uses: codecov/codecov-action@v3
53-
if: startsWith(matrix.os, 'ubuntu')
54-
with:
55-
file: lcov.info

Project.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Gtk4Makie"
22
uuid = "478199e7-b407-4926-87ea-7196203a28d8"
3-
version = "0.2.6"
3+
version = "0.3.0"
44

55
[deps]
66
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
@@ -23,13 +23,13 @@ Gtk4MakieCairoMakieExt = "CairoMakie"
2323
[compat]
2424
CairoMakie = "0.11, 0.12"
2525
Colors = "0.11, 0.12"
26-
FileIO = "1.9"
26+
FileIO = "1.10"
2727
GLMakie = "0.10.7"
28-
GeometryBasics = "0.4.1"
29-
Gtk4 = "0.6.6"
28+
GeometryBasics = "0.4.11"
29+
Gtk4 = "0.7"
3030
Makie = "0.21"
3131
ModernGL = "1"
3232
PrecompileTools = "1"
3333
Preferences = "1"
3434
ShaderAbstractions = "0.4"
35-
julia = "1.9"
35+
julia = "1.10"

src/attributes.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,6 @@ function attributes_window(f=current_figure())
454454
q=findfirst(s->glarea(s).figure == f, screens)
455455
if q !== nothing
456456
screen_window = window(screens[q])
457-
Gtk4.transient_for(win, screen_window)
458457
signal_connect(screen_window,"close-request") do w
459458
destroy(win)
460459
return false

src/settings_widgets.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,15 @@ end
5252
mutable struct TextBox{T} <: GtkEntry
5353
handle::Ptr{GObject}
5454
obs::Observable
55+
obsfunc
5556
T
5657

5758
function TextBox(observable::Observable, T=String; kwargs...)
5859
entry = GtkEntry(; kwargs...)
5960

6061
widget = new{T}(getfield(entry,:handle), observable)
6162

62-
on(observable; update=true) do val
63+
widget.obsfunc = on(observable; update=true, weak=true) do val
6364
@idle_add Gtk4.G_.set_text(widget, string(val))
6465
end
6566

@@ -88,6 +89,13 @@ function activated_cb_color(p::Ptr, propspec, obs::Observable{T}) where T
8889
nothing
8990
end
9091

92+
function tooltip_query_cb(p::Ptr, x, y, keyboard_mode, tooltip_ptr, user_data)
93+
b = convert(GtkColorDialogButton,p)
94+
tooltip = convert(GtkTooltipLeaf, tooltip_ptr)
95+
Gtk4.G_.set_text(tooltip, repr(b.obs[]))
96+
return Int32(true)
97+
end
98+
9199
_colorconv(s::Symbol) = parse(Colorant, s)
92100
_colorconv(s::AbstractString) = parse(Colorant, s)
93101
_colorconv(s) = s
@@ -100,6 +108,9 @@ mutable struct ColorButton{T} <: GtkColorDialogButton
100108
cb = GtkColorDialogButton(GtkColorDialog(); kwargs...)
101109
widget = new{T}(getfield(cb, :handle), observable)
102110

111+
Gtk4.on_query_tooltip(tooltip_query_cb, cb, nothing)
112+
Gtk4.G_.set_has_tooltip(cb, true)
113+
103114
on(observable; update=true) do val
104115
new_rgba = convert(GdkRGBA,_colorconv(val))
105116
if new_rgba != get_rgba(widget)

0 commit comments

Comments
 (0)