Opened 2 years ago

Last modified 6 months ago

#3348 new defect

wxGTK3: Gtk-CRITICAL **: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkSpinButton

Reported by: neteler Owned by: grass-dev@…
Priority: normal Milestone: 7.4.5
Component: wxGUI Version: svn-trunk
Keywords: wxGUI Cc:
CPU: Unspecified Platform: Unspecified

Description

The terminal gets flooded with such warnings (I am using wxGTK3-3.0.3 on Fedora).

To reproduce:

d.vect --ui
## switch to "Line" tab
(forms.py:5716): Gtk-CRITICAL **: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkSpinButton
(forms.py:5716): Gtk-CRITICAL **: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkSpinButton
...

Related comment:

On Wed, May 17, 2017 at 3:18 AM, <bugzilla@…> wrote:

https://bugzilla.redhat.com/show_bug.cgi?id=1411165

--- Comment #15 from Scott Talbert ---

(wxgui.py:4072): Gtk-CRITICAL : gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkCheckButton

The latter one is likely that there isn't enough space allocated for a check button widget - most likely has to be fixed in GRASS.

Change History (13)

comment:1 Changed 2 years ago by annakrat

Any idea which checkbox is causing that?

comment:2 in reply to:  1 Changed 2 years ago by neteler

Replying to annakrat:

Any idea which checkbox is causing that?

When moving the mouse over the "width" widget, a lot of warnings appear in the terminal.

The same, when opening the width_column dropdown.

comment:3 Changed 2 years ago by neteler

Milestone: 7.2.27.2.3

Ticket retargeted after milestone closed

comment:4 Changed 19 months ago by martinl

Milestone: 7.2.3

Ticket retargeted after milestone closed

comment:5 Changed 19 months ago by martinl

Milestone: 7.2.4

comment:6 Changed 18 months ago by mlennert

I'm also getting a lot of these messages, but the amount depends on the size I allow for the GUI window of d.vect or d.rast. Using a tabbed window manager, I get many of such messages when I add the GUI windows next to many existing windows. However, when I provide a +/- full screen for the GUI window, I get only very few such messages.

I can confirm that the width widgets in the Line tab cause a lot of these messages. The same goes for the label_size widget in the Labels tab.

When launching the d.rast GUI window in tabbed window mode, I get a lot of these messages:

gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook

I get quite a lot of these messages also when I launch d.vect --ui, but with tabs on top, not on the left.

In short: it seems that this really depends on window layout, which it shouldn't. Whatever the window layout, we shouldn't see our terminals flooded with such messages. Is there any way of making this more robust ?

comment:7 in reply to:  1 ; Changed 16 months ago by mlennert

Replying to annakrat:

Any idea which checkbox is causing that?

Picking up on this and on the redhat bugzilla link in the OP: after some tests, it seems to me that it is the "Render" checkbox in the bottom right hand corner of the g.gui Map Display or of the d.mon window that causes this message. In the default size, both in English and even more so in French the label of the checkbox is too long and cannot be displayed entirely. If I enlargen the window to the point where the entire label is displayed I do not get any of these error messages.

Would it be an idea to move this checkbox to more of a central position, to the left of the drop down menu (which BTW is also too narrow to accommodate the entire label text) ?

comment:8 in reply to:  7 Changed 16 months ago by mlennert

Replying to mlennert:

Replying to annakrat:

Any idea which checkbox is causing that?

Picking up on this and on the redhat bugzilla link in the OP: after some tests, it seems to me that it is the "Render" checkbox in the bottom right hand corner of the g.gui Map Display or of the d.mon window that causes this message. In the default size, both in English and even more so in French the label of the checkbox is too long and cannot be displayed entirely. If I enlargen the window to the point where the entire label is displayed I do not get any of these error messages.

Just to confirm, not displaying the Render checkbox by commenting the part as shown below makes the "gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkCheckButton?" errors go away.

Index: gui/wxpython/mapdisp/frame.py
===================================================================
--- gui/wxpython/mapdisp/frame.py	(révision 72717)
+++ gui/wxpython/mapdisp/frame.py	(copie de travail)
@@ -230,8 +230,8 @@
             self.statusbarItems, mapframe=self, statusbar=statusbar)
         self.statusbarManager.AddStatusbarItem(
             sb.SbMask(self, statusbar=statusbar, position=2))
-        sbRender = sb.SbRender(self, statusbar=statusbar, position=3)
-        self.statusbarManager.AddStatusbarItem(sbRender)
+        #sbRender = sb.SbRender(self, statusbar=statusbar, position=3)
+        #self.statusbarManager.AddStatusbarItem(sbRender)
 
         self.statusbarManager.Update()

comment:9 Changed 15 months ago by ychemin

Similar yet different problem here: I tried Moritz sbRender trick, and it did not have any effect.

I am tempted to hide the warnings by this trick, but this is not treating the cause of the problem...

https://stackoverflow.com/questions/3424774/how-to-suppress-gtk-warnings-from-a-wxwidgets-wxpython-application

Here are a tiny sample of the Warnings.

(wxgui.py:4275): Gtk-WARNING **: 22:38:45.307: gtk_widget_size_allocate(): attempt to underallocate wxPizza's child GtkNotebook 0x55d4d0a42b40. Allocation is 749x183, but minimum required size is 829x183.

(wxgui.py:4275): Gtk-CRITICAL **: 22:38:45.308: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook

(wxgui.py:4275): Gtk-WARNING **: 22:38:45.324: gtk_widget_size_allocate(): attempt to underallocate wxPizza's child GtkNotebook 0x55d4d0a42b40. Allocation is 749x183, but minimum required size is 829x183.

(wxgui.py:4275): Gtk-CRITICAL **: 22:38:45.324: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook

The last comment, it looks like WxPython? => Notebooks (Gtk) do not like negative values, and complain no end when given such values.

Last edited 15 months ago by ychemin (previous) (diff)

comment:10 in reply to:  9 Changed 14 months ago by mlennert

Replying to ychemin:

Similar yet different problem here: I tried Moritz sbRender trick, and it did not have any effect.

One difficulty here is that whether you see any of these error messages can also depend on your locale. The Render checkbox in the Map Display does not cause any messages when I set the language in the GUI preferences to 'en', but I get tons of messages when I use my system locale, French. In French, the text of the render checkbox goes beyond the edge of the Map Display.

This means sizes have to be defined flexibly in order to accommodate translations. No idea how hard that is.

comment:11 Changed 14 months ago by ychemin

Found a generic Linux solution here:

https://askubuntu.com/questions/505594/how-to-stop-gedit-and-other-programs-from-outputting-gtk-warnings-and-the-like

in .bashrc:

_supress() {

eval "$1() { \$(which $1) \"\$@\" 2>&1 | tr -d '\r' | grep -v \"$2\"; }"

}

_supress grass75 "wxPizza"

_supress grass75 "gtk_widget"

_supress grass75 "GtkNotebook?"

_supress grass75 "GtkProgressBar?"

_supress grass75 "GtkBox?"

_supress grass75 "GtkWindow?"

But I am loosing access to the GRASS CLI... and once inside GRASS the last three warnings still appear.

Last edited 14 months ago by ychemin (previous) (diff)

comment:12 Changed 14 months ago by ychemin

Some more details from this thread: https://trac.wxwidgets.org/ticket/17585 This is a similar (identical?) issue.. gtk+3.20 and wxGTK3.20

comment:13 Changed 6 months ago by neteler

Milestone: 7.2.47.4.5

Super boring terminal "spam" still there...

Note: See TracTickets for help on using tickets.