Search code examples
juliagtk

Items in a List are not visible(Julia, Gtk.jl)?


I have a Window with some widgets. This window is already visible. Then I create a new List and push it into this window. There I have a problem: the names of columns are displayed, but the rows itself not. Sometimes it works correctly, everything is displayed (the rows), sometimes not, but have to. BUT! When i hide the window and open it agan the rows appears. May be you have any ideas about that or has someone encountered this?


Solution

  • Gtk (the underling library) refreshes its windows under two circumstances: when a window's outline is changed on screen and when the user tells it to refresh the widow. Gtk.jl, however, does not itself tell the Gtk package to refresh when you change the contents of the listing.

    See also: GTK+ - Refresh a scrolledwindow

    So you do need to refresh the listing window yourself, and hiding and showing the window with each change in the listing is quick enough with Gtk for that to be fine as a solution unless you are doing hundreds of such changes, in which case you might want to only refresh the window after the changes complete.