Opened 8 years ago

Last modified 3 years 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: 8.0.0
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 (16)

comment:1 by annakrat, 8 years ago

Any idea which checkbox is causing that?

in reply to:  1 comment:2 by neteler, 8 years ago

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 by neteler, 7 years ago

Milestone: 7.2.27.2.3

Ticket retargeted after milestone closed

comment:4 by martinl, 7 years ago

Milestone: 7.2.3

Ticket retargeted after milestone closed

comment:5 by martinl, 7 years ago

Milestone: 7.2.4

comment:6 by mlennert, 7 years ago

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 ?

in reply to:  1 ; comment:7 by mlennert, 7 years ago

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) ?

in reply to:  7 comment:8 by mlennert, 7 years ago

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 by ychemin, 6 years ago

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 6 years ago by ychemin (previous) (diff)

in reply to:  9 comment:10 by mlennert, 6 years ago

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 by ychemin, 6 years ago

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 "Notebook"

_supress grass75 "wxPizza"

_supress grass75 "gtk_widget"

Version 0, edited 6 years ago by ychemin (next)

comment:12 by ychemin, 6 years ago

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 by neteler, 6 years ago

Milestone: 7.2.47.4.5

Super boring terminal "spam" still there...

comment:14 by arjan, 3 years ago

Milestone: 7.4.57.8.4

Still seeing this with v7.8.

comment:15 by neteler, 3 years ago

Milestone: 7.8.48.0.0

Ticket retargeted after milestone closed

comment:16 by Sylvain POULAIN, 3 years ago

Note: See TracTickets for help on using tickets.