Gtk.jl icon indicating copy to clipboard operation
Gtk.jl copied to clipboard

gdk_window_get_scale_factor: assertion ‘GDK_IS_WINDOW (window)’ failed

Open abahm opened this issue 5 years ago • 2 comments

#= Using Julia v1.2.0 with Gtk v0.17.0, running Win10 or Mac v10.14.6. This text can be cut/paste to REPL to duplicate issue.

A window holding a grid, holding a notebook, holding a canvas generates 5 assertions like:

(:47666): Gdk-CRITICAL **: 11:53:46.732: gdk_window_get_scale_factor: assertion ‘GDK_IS_WINDOW (window)’ failed =#

using Gtk

#= build gtk widgets =# canvas = GtkCanvas() notebook = GtkNotebook() push!(notebook, canvas, “my canvas”)

#= layout gtk widgets =# grid = GtkGrid() grid[1,1] = notebook

#= create window =# win = GtkWindow(“my window”) push!(win, grid) showall(win)

abahm avatar Sep 22 '19 17:09 abahm

Try this

using Gtk

#= build gtk widgets =#
canvas = GtkCanvas();
grid1 = GtkGrid();
grid1[1,1] = canvas;
notebook = GtkNotebook();
push!(notebook, grid1, "my canvas");

#= layout gtk widgets =#
grid = GtkGrid();
grid[1,1] = notebook;

#= create window =#
win = GtkWindow("my window");
push!(win, grid);
showall(win);

I am not 100% sure why this is the case, but I recall that I needed to do this in the past. In the end one will put a layout widget into the notebook anyway.

tknopp avatar Sep 22 '19 17:09 tknopp

Putting in an intermediate grid does prevent the assert for me too. Not clear why this is, but thanks!

abahm avatar Sep 22 '19 21:09 abahm