I see now why you do a Form.update...so that if you have other info being
displayed on the form that is not on the grid, but dependent upon its
position.

However, I did see multiple calls to _syncCurrentRow, when changing rows
(grid.SelectionMode='Row') which seems to induce unnecessary refreshes
triggered by _setCurrentRow

        #original...
        def _syncCurrentRow(self):
                """Sync the CurrentRow of the grid to the RowNumber of the
bizobj.

                Has no effect if the grid's DataSource isn't a link to a
bizobj.
                """
                bizobj = self.getBizobj()
                if bizobj:
                        self.CurrentRow = bizobj.RowNumber 

        #suggested..
        def _syncCurrentRow(self):
                """Sync the CurrentRow of the grid to the RowNumber of the
bizobj.

                Has no effect if the grid's DataSource isn't a link to a
bizobj.
                """
                bizobj = self.getBizobj()
                if bizobj:
                        #LAL - Prevent multiple execution
                        if self.CurrentRow<>bizobj.RowNumber:
                                self.CurrentRow = bizobj.RowNumber 

Or perhaps a better solution would be to find out why it is getting called
multiple times to begin with?

Larry Long

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, October 09, 2007 9:12 AM
To: 'Dabo Users list'
Subject: Re: [dabo-users] flash on grids - on windows

Taking a cursory look at some of the code in dGrid...is it possible that if
dGrid.SelectionMode=="Row" and we update a single cell then the whole row
gets updated (i.e. def _updateSelection)? 

Also I see a call to self.Form.update() in dGrid._onGridCellSelected.  Is
this necessary? Why not update just the cell, row, or grid vs the entire
form?

Larry Long

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of johnf
Sent: Tuesday, October 09, 2007 2:49 AM
To: Dabo Users list
Subject: Re: [dabo-users] flash on grids - on windows

On Monday 08 October 2007 18:58, Ed Leafe wrote:
> On Oct 8, 2007, at 8:44 PM, johnf wrote:
> > Well, if anybody should know it's you.  But from what I can see, for 
> > every row and col in the grid it does the below and it does it more 
> > than once - looks like four times.
> >
> > def GetAttr(self, row, col, kind=0):
> > try:
> >                     dcol = self.grid.Columns[col]
> >
> > Which in turn get values of the data items.
>
>       No, that's not correct. 'self.grid.Columns[col]' is simply a 
> reference to a particular column; GetAttr() is the wxPython method of 
> determining a column's display attributes.
>
> > Also, for some reason it appears to call "IsEmptyCell()".  However, 
> > I do not see where Dabo is making such a call.  I'll assume that it 
> > comes from wx.
>
>       Yes.
>
> > That's what I mean by 'Dabo re-reads the dataset'.
>
>       The dataset doesn't change. The grid has to *access* the values that

> are in the *current* dataset; otherwise, how would they ever get 
> displayed? There is no requerying, or recalculating, or any round- 
> tripping going on.
>
> > IMO I think this has something to do with "GetValue" of the grid.
>
>       Again, this simply returns the particular value in the *current* 
> dataset for the requested row/col.
>
> > I only see the flashing on Windows no flashing on Linux.
> > "displayLock" does not elimitate the problem.
>
>       Do you see that with all grids on Windows? IOW, if you run DaboDemo,

> or SimpleFormWithBizobj.py, do those grids exhibit the same behavior?
>
> -- Ed Leafe
I'll check into what happens with the demo apps when I get my profiler to
work with the demo's.  Maybe on Tuesday.

But so far I have discovered on my forms the "dGrid.GetAttr" is called while
moving the mouse over the grid.  And a grid with only one row calls
"dGrid.GetAttr" over 25 times after I click on the row.  I can provide a
file with the calls if required.  

At this point I'm wondering if "dGrid.GetAttr" is being called for all the
bizobj fields of the form?  My grid has five columns and had only one record
(row).  But the click produced over 25 calls (scrolled off the shell window
so I could only count 25).  

It's late I'll provide more information on Tuesday.   BTW I do not see the 
flashing on the Demo.  Which implies that some process (virtual fields?) is
slowing down the display enough for me to notice.

I really need to make a test case to better study what is happening.
--
John Fabiani


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/dabo-users/!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAafA2fnYuPUOMNFpIYnBEQcKAAAAQAAAAUKz5/[EMAIL
 PROTECTED]

Reply via email to