--
To unsubscribe, send email to wxPython-user...@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
-- -------------------------------------------------- Tobias Weber CEO The ROG Corporation GmbH Donaustaufer Str. 200 93059 Regensburg Tel: +49 941 4610 57 55 Fax: +49 941 4610 57 56 www.roglink.com Geschäftsführer: Tobias Weber Registergericht: Amtsgericht Regensburg - HRB 8954 UStID DE225905250 - Steuer-Nr.184/59359 --------------------------------------------------
Hi All,
--
To unsubscribe, send email to wxPython-user...@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
Adding a "print self.attr" will give you a bunch of these:
<wx.grid.GridCellAttr; proxy of wxPython wrapper for DELETED
GridCellAttr object! (The C++ object no longer exists.) >
So something is deleting the C++ object when you are not expecting it.
In this case it is the attr object itself as its refcount will be
reduced when the return value from GetAttr is used, so it will delete
itself because it is reaching zero. If you increment it an extra time
when you create it then that will let it know that you are keeping an
extra reference so you can use it again.
def GetAttr(self):
"""
Returns the attribute to use for this specific cell.
:returns: an instance of `wx.grid.GridCellAttr`.
"""
if self.attr is not None:
self.attr.IncRef()
return self.attr
else:
attr = gridlib.GridCellAttr()
attr.SetRenderer(XLSRenderer(self))
attr.SetSize(*self.size)
attr.SetOverflow(True)
self.attr = attr
self.attr.IncRef() # <--
return self.attr
>
>
> 2) `wx.grid.Grid` seems to completely redraw itself at every resize
> event, even if the cell content has not changed and it has not been
> damaged. This happens also in the "MegaGrid" sample in the wxPython
> demo. Why is that? I thought that the undamaged/unchanged cells should
> just be skipped from refreshing. I have tried to add wx.CLIP_CHILDREN
> and wx.NO_FULL_REPAINT_ON_RESIZE on the parent window, to no avail.
Yes it should, but I seem to recall something from way back about some
cases where not enough is being refreshed and so changes were added to
the grid to be more aggressive about refreshing. The grid window's
paint does try to calculate which cells intersect the update region and
then only call the renderer's Draw method for those cells, but if
something else is marking the whole window as invalid then the whole
thing will end up in the update region.
--
Robin Dunn
Software Craftsman
http://wxPython.org
2) `wx.grid.Grid` seems to completely redraw itself at every resize
event, even if the cell content has not changed and it has not been
damaged. This happens also in the "MegaGrid" sample in the wxPython
demo. Why is that? I thought that the undamaged/unchanged cells should
just be skipped from refreshing. I have tried to add wx.CLIP_CHILDREN
and wx.NO_FULL_REPAINT_ON_RESIZE on the parent window, to no avail.
Yes it should, but I seem to recall something from way back about some cases where not enough is being refreshed and so changes were added to the grid to be more aggressive about refreshing. The grid window's paint does try to calculate which cells intersect the update region and then only call the renderer's Draw method for those cells, but if something else is marking the whole window as invalid then the whole thing will end up in the update region.
Excellent as usual! It's always festive when a new AGWidget hits the list.
Two comments:
1) In the screenshots, it seems like the cells vertical and horizontal
lines are ahead by one pixel compared with the lines of the column and
row headers. It's not a big deal but maybe there is some easy way to
adjust that.
2) If it doesn't do it already, I would recommend you make it be able
to cut/copy/paste data to and from the clipboard with Ctr-X, -C, and
-V, as Excel does. This should be easy to do, and I got a recipe for
it online some where years back, and there is also the grid edit
mixin, here: http://sourceforge.net/projects/pywxgridedit/.
Depending on what you want to do I could try to add the patch from
what I have, but maybe the way I'm doing it is not the way you'd want.
Che
On 11 août, 08:40, Andrea Gavana <andrea.gav...@gmail.com> wrote:
I did not say the application is not working. I'm just saying,
I'm not very comfortable with the coding of the characters.
Did you check with an another destination, like a wx-ansi build?
Understand a different coding.
I did it. There are some problems. Not because of "unicode/ansi",
but because of the lack of character coding handling. This is
what I'm calling a design flaw.
> it's been a while since my last "announcement"... Anyway, I am
> happy to announce the birth of my latest child, XLSGrid.
Very nice!
One issue:
The "shrink to fit" text shrinks o.k..
However, it does not expand again when extending the border again.
(Debian testing, Python 2.6.7, wxPython 2.8.10.1 (unicode), xlrd 0.6.1)
Cheers
Martin
around line 1967:
for j in xrange (ncols):
if j in sheet.colinfo_map:
current = sheet.colinfo_map [j]. width
else:
current = sheet.defcolwidth
# # # ADDED
if not current == None:
col_width = int (round (float (default_width) * current/256.0))
else:
col_widht = 20 # Set a fixed size for cell
# # # END
-- Tim Roberts, ti...@probo.com Providenza & Boekelheide, Inc.
However, I have just moved to a new house and I wont have internet
connection for some time, and I can't use SVN from work. Maybe someone
in our pool of kind developers (Robin, Kevin, Cody, Chris, etc...)
with SVN write access could apply that modification for me; otherwise
you will have to wait a week or two for me to be back to speed.
Andrea.
Hello, sorry for the delay but lately I've had trouble connecting to the Internet.
The point is that I am generating (using xlwt) an Excel document, from the data loaded in a form and stored in a SQLite database, to then load this document in my application using XLSGrid.
Queries to the database, return, in some fields a None value (for example, a date that is not loaded in the form and get a default None value in the database), and are those fields that cause the error.
I assume that indeed is a bug in xlwt (which I have not checked), which did not consider the nature of the document created, since it is very different to create a spreadsheet using OpenOffice, Excel or similar, to create it in a rather more "Handcrafted" way.
The Excel File is in : https://docs.google.com/open?id=0B6iCxVHg0ejlQk9DSG1ZZ2dWeDA
And thank you very much for the suggestions and corrections regarding the conditional, sometimes I have a tangled mind, so sometimes I make some strange errors.