JuliaGtk / Gtk4.jl

Julia package for Gtk4 using GObject introspection
Other
58 stars 2 forks source link

Include order of GLMakie and Gtk4 causes main application window to not appear. #66

Open chriskmanx opened 6 months ago

chriskmanx commented 6 months ago

Environment is OSX and Julia 1.9.3.

Like this the main application window shows:

#using GLMakie
using Gtk4

Like this the main application window shows:

using GLMakie
using Gtk4

Like this the main application window does NOT show:

using Gtk4
using GLMakie
import Pkg
julia> function package_version(packagename::String)
           Pkg_m = Pkg.Operations.Context().env.manifest
           thepackage = findfirst(v -> v.name == packagename,Pkg_m)
           if isnothing(thepackage)
               ""
           else
               Pkg_m[thepackage].version
           end
       end
package_version (generic function with 1 method)

package_version("GLMakie")
v"0.9.10"

Application window is constructed thusly :

application_window = GtkWindow("Main Window", appwindow_default_x_dimensions, appwindow_default_y_dimensions,appwindow_resizable,appwindow_initial_visible)

where X and Y dimensions are integers and the remaining parameters are booleans.

chriskmanx commented 6 months ago

For clarity, the visible flag is set ( it is the default ) but we ensure it is set explicitly for good measure and call present() for extra measure:

    println("Making application window visible...")
    application_window.visible = true

    println("-----------Application Window----------------")
    println(application_window)
    println("---------------------------------------------")

    present(application_window) # should put window on top on Windows & Linux
                                # OSX needs app bundle 
                                # for proper foregrounding
jwahlstrand commented 6 months ago

If I add "using GLMakie" to the "application.jl" example I don't see this issue on Linux. Does that reproduce it for you?

chriskmanx commented 6 months ago

I am away from my machine at this time, but so shall try that when I get home.

chriskmanx commented 6 months ago

So I tried to make "application.jl" reproduce the error ( OSX ) but that seemed to work fine. I'll see if I can cut my application down to a skeleton and post that here.