Python Forum

Full Version: WxGrid Title
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I created a few wxGrid on a wxFrame. I need to have a title displayed on each of them. I am wondering if possible to set it on the left-top corner which is empty. Thanks.

import wx
import wx.grid

app = wx.App()
window = wx.Frame(None, -1, title='Test', size=(960, 850), pos = (-5, 0))
background = wx.Panel(window)
background.SetBackgroundColour("Blue")

grid = wx.grid.Grid(background, size=(312,150), pos=(0,0))
grid.CreateGrid(6,6)

window.Show()
app.MainLoop()
There currently is no title attribute on wx.Grid
see: https://wxpython.org/Phoenix/docs/html/w...le-wx.grid
You could overload the class with your own and add a title attribute
this could be done by simple attaching a TextCtrl to the Grid and a sizer for both
Thank you very much. It is great to hear it.
I just started to use python less than a month, not sure where to start to overload the class. And I will appreciate if you can get me more info in detail. It sounds like python is a nice language that can be changed as you need! Thanks.
It's late, and I'm going to bed for the night.
I'll write up an example tomorrow, or perhaps someone else will pick this up
before then.