At 00:22 02/07/2004 -0300, Luis M. Gonzalez wrote:
>Hi there,
>
>I just wanted to know if there will be an implementation of wxGrid in
>PythonCard.
>I found an old posted message from KA pointing to a couple of samples
>(grid.py and simplegrid.py) but these links seem to be broken.
>
>If we can't count with this widget implemented, is there any easy way to
>include a grid in a PythonCard app?
The PythonCard distribution does include a component for Grid - but the
Resource Editor doesn't include it in the list of components that can be
inserted (but see below).
The samples directory does include the simplegrid.py - and if you go run
it, it does seem to work. But the Samples Launcher doesn't include it.
The readme.txt in SimpleGrid says
>This is a work-in-progress sample to test the PythonCard Grid component.
>
>It is a very basic port of the wxPython\demo\GridSimple.py code.
>
>The events are manually bound in the openBackground handler, but will
>eventually be wrapped in PythonCard.
So I think there is a basic Grid component, but there isn't yet any way to
use all (or many) of its features except by going direct to wxGrid.
The sample dbBrowser2 uses a Grid component (by creating the component
dynamically).
I think between those two samples you can probably figure out how to do
include one.
Either
1. sneakily
- run the Resource Editor to define some of your resources
- save the rsrc.py file, manually edit it to include a grid (cut/paste
from SimpleGrid.rsrc.py)
- now the Resource Editor will let you edit or update the grid component
2. dynamically - as in dbBrowser2.py
In either case, you'll still need to bind events directly, as SimpleGrid does.
Good luck
-- Alex.
|