Skip to content

Commit

Permalink
Allow GLMakie to change the title of a screen after its creation.
Browse files Browse the repository at this point in the history
Previously, GLFW.SetWindowTitle() was needed, which required adding the GLFW package to the script. This change just wraps GLFW.SetWindowTitle() into GLMakie.set_screen_title!().
  • Loading branch information
lpaulino07 committed Dec 17, 2024
1 parent a1e9fdf commit c2f6cf5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions GLMakie/src/screen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,20 @@ function set_screen_visibility!(nw::GLFW.Window, visible::Bool)
GLFW.set_visibility!(nw, visible)
end

function set_screen_title!(screen::Screen, title::String)
if !screen.owns_glscreen
error(unimplemented_error)
end

set_screen_title!(screen.glscreen, title)
screen.config.title = title
end

function set_screen_title!(nw::GLFW.Window, title::String)
@assert nw.handle !== C_NULL
GLFW.SetWindowTitle(nw, title)
end

function display_scene!(screen::Screen, scene::Scene)
@debug("display scene on screen")
resize!(screen, size(scene)...)
Expand Down

0 comments on commit c2f6cf5

Please sign in to comment.