wxPython on Ubuntu18.04 grid scroll gives error

933 views
Skip to first unread message

akshath Singhal

unread,
Jul 3, 2019, 2:42:21 PM7/3/19
to wxPython-users
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()

wxglade_out.py

akshath Singhal

unread,
Jul 3, 2019, 2:51:47 PM7/3/19
to wxPython-users
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.

akshath Singhal

unread,
Jul 3, 2019, 2:54:22 PM7/3/19
to wxPython-users
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.

Robin Dunn

unread,
Jul 8, 2019, 2:24:18 PM7/8/19
to wxPython-users
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


akshath Singhal

unread,
Jul 8, 2019, 9:05:19 PM7/8/19
to wxPython-users
Thanks for the answer. Can you provide some guidance as to how these warnings can be redirected?

Robin Dunn

unread,
Jul 9, 2019, 11:25:25 AM7/9/19
to wxPython-users
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?


Reply all
Reply to author
Forward
0 new messages