I am working on a python application where most of the GUI is written in TKinter, but I need a data grid control like Excel. I know tktreectrl is supposed to do this but I am unable to get the latest version to compile. What I want to know is if/how to call some wxpython code from my tkinter code. I tried:

def showDataViewer(self):
     app = wx.App()
     data_viewer = GeneticViewer()
     app.MainLoop()

It does pop up the window, but when I close the wxPython window it causes my entire application to crash generating a Mac OS X bug report. Any ideas? Thanks

but I am unable to get the latest version to compile

What distro are you using as it is in most repositories.

Edited 5 Years Ago by woooee: n/a

You can import the wx module into you code.

implemet the class of wx.grid. and call it into your Tkinter app.
One thing you must be carefule is to destroy the wx.grid before you call the close/destroy else you will have a crash in your app.

eg.....

def OnClose(self,event):
   self.grid.Destroy() ## say for wx Grid
   self.Destroy()    ## say for tK

And you should be fine :)

What distro are you using as it is in most repositories.

I'm using python 2.7.1

You can import the wx module into you code.

implemet the class of wx.grid. and call it into your Tkinter app.
One thing you must be carefule is to destroy the wx.grid before you call the close/destroy else you will have a crash in your app.

eg.....

def OnClose(self,event):
   self.grid.Destroy() ## say for wx Grid
   self.Destroy()    ## say for tK

And you should be fine :)

Thanks for this code, but still did not work. Added this to my gridviewer class and still had application crash with sig bus error

i gave you an idea. I dont use tk. but that should be how the algo should go. I can promise you that.
:)

This article has been dead for over six months. Start a new discussion instead.