Re: [wxPython] Basic Grid rendering questions
by Robin Dunn other posts by this author
Apr 30 2002 3:32AM messages near this date
Re: [wxPython] Hooking into the window destruction sequence
|
Re: [wxPython] Hooking into the window destruction sequence
> Hooking into the window destruction sequenceI wondered if those who have
> used the wxGrid component might comment on the following snippet. I will
try
> to follow up with an improved copy, and maybe a few more question marks
:-)
>
> Tabbed at 4sp.
>
> regards
> Steve
>
> #
> # This code is an annotated copy of <wxPython>/demo/GridStdEdRend.py
> #
> # The focus on the annotation is to try to understand wtf goes on here.
> #
>
> class MyCustomRenderer(wxPyGridCellRenderer):
> def __init__(self):
> wxPyGridCellRenderer.__init__(self)
>
> def Draw(self, # Your renderer instance
> grid, # ? the grid it renders in ?
Yes, in case you need to get the data value, or whatever.
> attr, # for text, accesses font attributes
> dc, # device context [what you draw on]
> rect, # clipping rectangle
> row, # vertical position
> col, # horizontal position
> isSelected): # ? interactive design [draw handles, etc.] ?
It's a boolean value that specifies if the cell is part of the current
selection or not. (IOW, you've dragged the mouse over a series of cells.)
It's go you can draw the cell differently if needed.
--
Robin Dunn
Software Craftsman
robin@[...].com Java give you jitters?
http://wxPython.org Relax with wxPython!
_______________________________________________
wxpython-users mailing list
wxpython-users@[...].org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users
Thread:
Jeff Kotula
Robin Dunn
Matthew Sherborne
Robin Dunn
Robin Dunn
Bernhard Herzog
Bernhard Herzog
Mike C. Fletcher
Steve Holden
|