Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WxGrid Title
#1
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()
Reply
#2
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
Reply
#3
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.
Reply
#4
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  wxGrid::InsertRows ian 2 4,168 Aug-03-2017, 01:04 PM
Last Post: ian

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020