I am trying to figure out what this may be caused by in my application:
I am getting multiple (11 to be precise) of those messages after a window with a statusbar, a panned view (with a gtkdrawing area and a note book) and a header bar+few button is created – I am not deleting or removing any widgets at this time:
(gxsm4:151092): Gtk-WARNING **: 11:18:51.885: Trying to snapshot GtkStatusbar 0x559a9eda68a0 without a current allocation
But I do send updates/texts to the statusbar (possibly while loading data to be displayed) in this “window” – can there be a conflict of some kind I need to take care of?
The warning may also appear when the parent of the statusbar does not allocate a proper size to its statusbar child. What’s the parent widget of the statusbar?
Both g_idle_add() and g_timeout_add() do not use threads: they schedule the function you pass so that it’s called by the main loop at the appropriate time.
Excellent, that confirms my understanding about those and then there is no potential issue related to idle functions I use to do updates on a periodic manner! I designed a kind of state machine for longer tasks which is executed in idle time and processes at every call some work completed quickly – I need to check on hi level instrument status and coordinate jobs.
…parent of the statusbar does not allocate a proper size to its statusbar child.
How shall I understand this? Or what can I do assure it’s good?
Anyhow, I do not see anything strange, the status bar works as intended.
That warning can be caused by a ton of things. It essentially means that the status bar was not given a proper size by the parent widget before the rendering part of the current frame, or that the required size of the status bar changed after it already got a proper size.
We can’t say for sure what’s going wrong in your case exactly.
If you can come up with a standalone reproducer that exhibits the same problem, that would help.
I tried to reproduced in a minimal application but can not generate the warning in a simple context.
With a little more looking at it and debugging I tracked it down to the status updates I push when loading data/image and creating three “On Screen Info” info markers within my drawing area. And when setting those up one by one their coordinates are updated and supposed to be shown in the status bar in a quick consecutive order – not that I would read it anyway at this time – but the object is doing that when activated or created.
And I find it is not shown at load time – unless I later touch/move them with the mouse manually, then all is fine.
In case there may be a hint, the “load” is executed via a callback triggered by a file dialog response – or via a drag-and-drop controller action. Both cases are triggering the warning.