Skip to content

Commit

Permalink
Migrate from SnoopPrecompile to PrecompileTools (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy authored Apr 25, 2023
1 parent 1e71b4a commit 47316e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Observables = "510215fc-4207-5dde-b226-833fc4488ee2"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
RoundingIntegers = "d5f540fe-1c90-5db3-b776-2e2f362d9394"
SnoopPrecompile = "66db9d55-30c0-4569-8b51-7e840670fc0c"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"

[compat]
Cairo = "1"
Expand All @@ -26,7 +26,7 @@ IntervalSets = "0.5, 0.6, 0.7"
Observables = "0.4, 0.5"
Reexport = "0.2, 1"
RoundingIntegers = "0.2, 1"
SnoopPrecompile = "1"
PrecompileTools = "1"
julia = "1.3"

[extras]
Expand Down
8 changes: 4 additions & 4 deletions src/precompile.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using SnoopPrecompile
using PrecompileTools

@precompile_setup begin
@setup_workload begin
function eventbutton(c, event_type, btn, x=DeviceUnit(0), y=DeviceUnit(0), state=0)
xd, yd = GtkObservables.convertunits(DeviceUnit, c, x, y)
Gtk.GdkEventButton(event_type,
Expand Down Expand Up @@ -40,15 +40,15 @@ using SnoopPrecompile
C_NULL,
0.0, 0.0)
end
const ModType = Gtk.GConstants.GdkModifierType
ModType = Gtk.GConstants.GdkModifierType
mask(btn) =
btn == 1 ? ModType.GDK_BUTTON1_MASK :
btn == 2 ? ModType.GDK_BUTTON2_MASK :
btn == 3 ? ModType.GDK_BUTTON3_MASK :
error(btn, " not recognized")

imgrand = rand(RGB{N0f8}, 100, 100)
@precompile_all_calls begin
@compile_workload begin
# slider
sl = slider(1:3)
sl[] = (1:5, 3)
Expand Down

0 comments on commit 47316e5

Please sign in to comment.