wxPython on Ubuntu18.04 grid scroll gives error

Using grid scroll on wxPython causes following error:

(wxglade_out.py:3029): Gtk-CRITICAL **: 23:59:48.646: gtk_widget_set_allocation: assertion ‘_gtk_widget_get_visible (widget) || _gtk_widget_is_toplevel (widget)’ failed

The code is as follows:

#!/usr/bin/env python

-- coding: UTF-8 --

wxglade_out.py (1.67 KB)

···

generated by wxGlade 0.8.0 on Wed Jul 3 19:57:39 2019

import wx
import wx.grid

begin wxGlade: dependencies

end wxGlade

begin wxGlade: extracode

end wxGlade

class MyFrame(wx.Frame):
def init(self, *args, **kwds):
# begin wxGlade: MyFrame.init
kwds[“style”] = kwds.get(“style”, 0) | wx.DEFAULT_FRAME_STYLE
wx.Frame.init(self, *args, **kwds)
self.SetSize((400, 300))
self.panel_2 = wx.Panel(self, wx.ID_ANY)
self.display_list = wx.grid.Grid(self, wx.ID_ANY, size=(1600,1100))
self.__set_properties()
self.__do_layout()
for i in range(24):
for j in range(24):
self.display_list.SetCellValue(i,j,str(i))
self.Refresh()
self.Update()
# end wxGlade

def __set_properties(self):
    # begin wxGlade: MyFrame.__set_properties
    self.SetTitle("frame")
    self.display_list.CreateGrid(25, 25)       
    # end wxGlade

def __do_layout(self):
    # begin wxGlade: MyFrame.__do_layout
    sizer_1 = wx.BoxSizer(wx.VERTICAL)
    sizer_2 = wx.BoxSizer(wx.VERTICAL)
    sizer_2.Add(self.display_list, 0, wx.EXPAND, 0)
    sizer_2.Add(self.panel_2, 0, wx.EXPAND, 0)
    sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
    self.SetSizer(sizer_1)
    self.Layout()
    # end wxGlade

end of class MyFrame

class MyApp(wx.App):
def OnInit(self):
self.frame = MyFrame(None, wx.ID_ANY, “”)
self.SetTopWindow(self.frame)
self.frame.Show()
return True

end of class MyApp

if name == “main”:
app = MyApp(0)
app.MainLoop()

I tried the same on Ubuntu 16 and no warning was generated. I am trying to build this open source application and require it to support most of the commonly used OS.
I believe the problem doesnt exist in libgtk3.18.9 but does in libgtk3.22.

···

On Thursday, July 4, 2019 at 12:12:21 AM UTC+5:30, akshath Singhal wrote:

Using grid scroll on wxPython causes following error:

(wxglade_out.py:3029): Gtk-CRITICAL **: 23:59:48.646: gtk_widget_set_allocation: assertion ‘_gtk_widget_get_visible (widget) || _gtk_widget_is_toplevel (widget)’ failed

The code is as follows:

#!/usr/bin/env python

-- coding: UTF-8 --

generated by wxGlade 0.8.0 on Wed Jul 3 19:57:39 2019

import wx
import wx.grid

begin wxGlade: dependencies

end wxGlade

begin wxGlade: extracode

end wxGlade

class MyFrame(wx.Frame):
def init(self, *args, **kwds):
# begin wxGlade: MyFrame.init
kwds[“style”] = kwds.get(“style”, 0) | wx.DEFAULT_FRAME_STYLE
wx.Frame.init(self, *args, **kwds)
self.SetSize((400, 300))
self.panel_2 = wx.Panel(self, wx.ID_ANY)
self.display_list = wx.grid.Grid(self, wx.ID_ANY, size=(1600,1100))
self.__set_properties()
self.__do_layout()
for i in range(24):
for j in range(24):
self.display_list.SetCellValue(i,j,str(i))
self.Refresh()
self.Update()
# end wxGlade

def __set_properties(self):
    # begin wxGlade: MyFrame.__set_properties
    self.SetTitle("frame")
    self.display_list.CreateGrid(25, 25)       
    # end wxGlade

def __do_layout(self):
    # begin wxGlade: MyFrame.__do_layout
    sizer_1 = wx.BoxSizer(wx.VERTICAL)
    sizer_2 = wx.BoxSizer(wx.VERTICAL)
    sizer_2.Add(self.display_list, 0, wx.EXPAND, 0)
    sizer_2.Add(self.panel_2, 0, wx.EXPAND, 0)
    sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
    self.SetSizer(sizer_1)
    self.Layout()
    # end wxGlade

end of class MyFrame

class MyApp(wx.App):
def OnInit(self):
self.frame = MyFrame(None, wx.ID_ANY, “”)
self.SetTopWindow(self.frame)
self.frame.Show()
return True

end of class MyApp

if name == “main”:
app = MyApp(0)
app.MainLoop()

Also, the problem occurs only after editing the cell value. Once the editor has been closed. That should narrow down the search for the error.

···

On Thursday, July 4, 2019 at 12:21:47 AM UTC+5:30, akshath Singhal wrote:

I tried the same on Ubuntu 16 and no warning was generated. I am trying to build this open source application and require it to support most of the commonly used OS.
I believe the problem doesnt exist in libgtk3.18.9 but does in libgtk3.22.

On Thursday, July 4, 2019 at 12:12:21 AM UTC+5:30, akshath Singhal wrote:

Using grid scroll on wxPython causes following error:

(wxglade_out.py:3029): Gtk-CRITICAL **: 23:59:48.646: gtk_widget_set_allocation: assertion ‘_gtk_widget_get_visible (widget) || _gtk_widget_is_toplevel (widget)’ failed

The code is as follows:

#!/usr/bin/env python

-- coding: UTF-8 --

generated by wxGlade 0.8.0 on Wed Jul 3 19:57:39 2019

import wx
import wx.grid

begin wxGlade: dependencies

end wxGlade

begin wxGlade: extracode

end wxGlade

class MyFrame(wx.Frame):
def init(self, *args, **kwds):
# begin wxGlade: MyFrame.init
kwds[“style”] = kwds.get(“style”, 0) | wx.DEFAULT_FRAME_STYLE
wx.Frame.init(self, *args, **kwds)
self.SetSize((400, 300))
self.panel_2 = wx.Panel(self, wx.ID_ANY)
self.display_list = wx.grid.Grid(self, wx.ID_ANY, size=(1600,1100))
self.__set_properties()
self.__do_layout()
for i in range(24):
for j in range(24):
self.display_list.SetCellValue(i,j,str(i))
self.Refresh()
self.Update()
# end wxGlade

def __set_properties(self):
    # begin wxGlade: MyFrame.__set_properties
    self.SetTitle("frame")
    self.display_list.CreateGrid(25, 25)       
    # end wxGlade

def __do_layout(self):
    # begin wxGlade: MyFrame.__do_layout
    sizer_1 = wx.BoxSizer(wx.VERTICAL)
    sizer_2 = wx.BoxSizer(wx.VERTICAL)
    sizer_2.Add(self.display_list, 0, wx.EXPAND, 0)
    sizer_2.Add(self.panel_2, 0, wx.EXPAND, 0)
    sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
    self.SetSizer(sizer_1)
    self.Layout()
    # end wxGlade

end of class MyFrame

class MyApp(wx.App):
def OnInit(self):
self.frame = MyFrame(None, wx.ID_ANY, “”)
self.SetTopWindow(self.frame)
self.frame.Show()
return True

end of class MyApp

if name == “main”:
app = MyApp(0)
app.MainLoop()

See response at https://github.com/wxWidgets/Phoenix/issues/1297

···

On Wednesday, July 3, 2019 at 11:42:21 AM UTC-7, akshath Singhal wrote:

Using grid scroll on wxPython causes following error:

(wxglade_out.py:3029): Gtk-CRITICAL **: 23:59:48.646: gtk_widget_set_allocation: assertion ‘_gtk_widget_get_visible (widget) || _gtk_widget_is_toplevel (widget)’ failed

Robin

Thanks for the answer. Can you provide some guidance as to how these warnings can be redirected?

···

On Monday, July 8, 2019 at 11:54:18 PM UTC+5:30, Robin Dunn wrote:

On Wednesday, July 3, 2019 at 11:42:21 AM UTC-7, akshath Singhal wrote:

Using grid scroll on wxPython causes following error:

(wxglade_out.py:3029): Gtk-CRITICAL **: 23:59:48.646: gtk_widget_set_allocation: assertion ‘_gtk_widget_get_visible (widget) || _gtk_widget_is_toplevel (widget)’ failed

See response at https://github.com/wxWidgets/Phoenix/issues/1297

Robin

https://www.guru99.com/linux-redirection.html

···

On Monday, July 8, 2019 at 6:05:19 PM UTC-7, akshath Singhal wrote:

Thanks for the answer. Can you provide some guidance as to how these warnings can be redirected?

Robin

It is really a helpful and important post I have ever found.The explanation is quite clear, and now I am searching for some solid guidance, that will help me in the redirection of the warnings from eduhelphub.com portal. Advance thanks for the help.