lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello,

I'm moving ahead with my application using lgi/gtk+ but I'm facing issue when I would like to hide and then restore a window. My code is the following :

---
window = Gtk.Window {
    title = "Vigie v" .. Vigie_version,
    icon_name = 'gnome-monitor',
    window_position = Gtk.WindowPosition.MOUSE,
    default_height = 150,
[blablabla my wingets here blablabla]
    _on_destroy_ = function ()
        window:hide()
    end
}

statusicon = Gtk.StatusIcon {
    visible = true,
    tooltip_text = "I'm not sure",
    _on_button_press_event_ = function ()
        window:show_all()
    end
}

Gtk.main()            -- make it alive, waiting for events
---

So, at startup, my appl only add an icon in the system tray.
* When I click on this icon, the main window of my application is (correctly) displayed.
* when I click on the closing winget, the window disappears as expected
* but when click again on the systray icon, the window re-appears but without the geometry I requested and totally empty of child's winget.

So ... where I'm wrong ?

Thanks

Laurent