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

Gtk.GtkWindowPosition.CENTER doesn't work

Open xetum opened this issue 5 years ago • 7 comments

using Gtk
win = GtkWindow("My First Gtk.jl Program", 400, 200)
win.window_position[Int] = Gtk.GtkWindowPosition.CENTER
showall(win)

window at top-left

xetum avatar May 21 '19 11:05 xetum

yes indeed. doesn't work here either

tknopp avatar May 21 '19 12:05 tknopp

  1. is gtk_window_set_position called?
  2. gtk docu says: "Window placement can be influenced using this enumeration. Note that using GTK_WIN_POS_CENTER_ALWAYS is almost always a bad idea. It won’t necessarily work well with all window managers or on all windowing systems."

lobingera avatar May 21 '19 12:05 lobingera

You can use Gtk.GAccessor.position(win, Gtk.GtkWindowPosition.CENTER) to call gtk_window_set_position but it doesn't seem to work so well.

There's also gtk_window_move:

https://github.com/JuliaGraphics/Gtk.jl/blob/fe6739a3a345ba804030c8d379daa15f30055903/gen/gbox3#L4984

jonathanBieler avatar May 21 '19 12:05 jonathanBieler

using Gtk, Gtk.ShortNames
# Create window
mainWin = Window()
# Properties for mainWin
set_gtk_property!(mainWin, :title, "SimBioReactor 1.0")
set_gtk_property!(mainWin, :window_position, 3) 

Kelvyn88 avatar Aug 07 '19 15:08 Kelvyn88

Duplicate of #396

Kelvyn88 avatar Aug 11 '19 00:08 Kelvyn88

@xetum @tknopp issue was solved?

Kelvyn88 avatar Jul 17 '20 17:07 Kelvyn88

@Kelvyn88 not yet solved as of Gtk.jl 1.2.2

xetum avatar Nov 26 '22 09:11 xetum