ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxPython-users
wxPython-users
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved