MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.4k stars 306 forks source link

Unable to specify monitor for screen #472

Closed grero closed 1 month ago

grero commented 5 years ago

I am trying to create a GL screen on a specific monitor. From this function https://github.com/JuliaPlots/GLMakie.jl/blob/76b57fad1a1a0674977ccf5b095bdaafa56be635/src/screen.jl#L181 it looks like I should be able to pass a monitor argument that will be passed onto GLFW.Window. However, I can't seem to get GLFW.Window to accept any keyword arguments.

  _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.2 (2018-11-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using GLFW, AbstractPlotting, GLMakie

julia> screen = GLMakie.Screen(monitor=1)
ERROR: MethodError: no method matching GLFW.Window(::Pair{Symbol,Int64}; name="Makie", resolution=(10, 10), windowhints=Tuple{UInt32,Int64}[(0x0002100d, 0), (0x00021005, 0), (0x00021004, 8), (0x00021001, 8), (0x00021002, 8), (0x00021003, 8), (0x00021006, 0), (0x0002100b, 0)], visible=false)
Closest candidates are:
  GLFW.Window(::Any) at /Users/roger/.julia/packages/GLFW/69NQ7/src/glfw3.jl:289 got unsupported keyword arguments "name", "resolution", "windowhints", "visible"
  GLFW.Window(; name, resolution, debugging, major, minor, windowhints, contexthints, visible, focus, fullscreen, monitor, share) at /Users/roger/.julia/packages/GLFW/69NQ7/src/glfw3.jl:310
  GLFW.Window(::Ptr{Nothing}) at /Users/roger/.julia/packages/GLFW/69NQ7/src/glfw3.jl:289 got unsupported keyword arguments "name", "resolution", "windowhints", "visible"
Stacktrace:
 [1] #Screen#23(::Tuple{Int64,Int64}, ::Bool, ::Base.Iterators.Pairs{Symbol,Int64,Tuple{Symbol},NamedTuple{(:monitor,),Tuple{Int64}}}, ::Type) at /Users/roger/.julia/packages/GLMakie/rAuGK/src/screen.jl:189
 [2] (::getfield(Core, Symbol("#kw#Type")))(::NamedTuple{(:monitor,),Tuple{Int64}}, ::Type{GLMakie.Screen}) at ./none:0
 [3] top-level scope at none:0

I believe I have the latest versions of the relevant packages

(Clocks) pkg> st
    Status `~/Documents/programming/julia/Clocks/Project.toml`
  [f7f18e0c]   GLFW v2.3.0
  [e9467ef8] + GLMakie v0.0.4
  [4d00f742]   GeometryTypes v0.7.2
    Status `~/Documents/programming/julia/Clocks/Manifest.toml`
  [621f4979] + AbstractFFTs v0.3.2
  [537997a7] + AbstractPlotting v0.9.5
  [13072b0f] + AxisAlgorithms v0.3.0
  [39de3d68] + AxisArrays v0.3.0
  [b99e7846] + BinaryProvider v0.5.3
  [a2cac450] + ColorBrewer v0.4.0
  [c3611d14] + ColorVectorSpace v0.6.2
  [5ae59095] + Colors v0.9.5
  [8f4d0f93] + Conda v1.2.0
  [d38c429a] + Contour v0.5.1
  [150eb455] + CoordinateTransformations v0.5.0
  [864edb3b] + DataStructures v0.15.0
  [7a1cc6ca] + FFTW v0.2.4
  [5789e2e9] + FileIO v1.0.5
  [b38be410] + FreeType v2.1.1
  [663a7486] + FreeTypeAbstraction v0.4.2
  [a2bd30eb] + Graphics v0.4.0
  [bbac6d45] + IdentityRanges v0.3.0
  [2803e5a7] + ImageAxes v0.5.0
  [a09fc81d] + ImageCore v0.7.4
  [6218d12a] + ImageMagick v0.7.1
  [02fcd773] + ImageTransformations v0.7.2
  [9b13fd28] + IndirectArrays v0.5.0
  [a98d9a8b] + Interpolations v0.11.2
  [8197267c] + IntervalSets v0.3.1
  [1914dd2f] + MacroTools v0.4.4
  [dbb5928d] + MappedArrays v0.2.1
  [e1d29d7a] + Missings v0.4.0
  [66fc600b] + ModernGL v1.0.0
  [77ba4419] + NaNMath v0.3.2
  [510215fc] + Observables v0.2.3
  [6fe1bfb0] + OffsetArrays v0.10.0
  [19eb6ba3] + Packing v0.3.0
  [5432bcbf] + PaddedViews v0.4.2
  [995b91a9] + PlotUtils v0.5.5
  [27ebfcd6] + Primes v0.4.0
  [dca85d43] + QuartzImageIO v0.5.2
  [b3c3ace0] + RangeArrays v0.3.1
  [c84ed2f1] + Ratios v0.3.0
  [189a3867] + Reexport v0.2.0
  [6038ab10] + Rotations v0.11.1
  [992d4aef] + Showoff v0.2.1
  [73760f76] + SignedDistanceFields v0.4.0
  [699a6c99] + SimpleTraits v0.8.0
  [a2af1166] + SortingAlgorithms v0.3.1
  [276daf66] + SpecialFunctions v0.7.2
  [2913bbd2] + StatsBase v0.27.0
  [1cfade01] + UnicodeFun v0.4.0
  [81def892] + VersionParsing v1.1.3
  [efce3f68] + WoodburyMatrices v0.4.1
ffreyer commented 1 month ago

Closing this as stale/outdated/solved. You can pass a GLFW.Monitor with display(fig, monitor = monitor) now, as well as some settings (see ?GLMakie.ScreenConfig)