Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Can I smooth scroll a TkTable? (was Re: Problems with grid, Scrolledwindow, and TkTable)
Jeff Hobbs wrote:
> ...
> As for the technical bits ... well, I make my life easy by not
> smooth scrolling.  All topleft coords start at an x,y that is set
> in the pre-calculated matrix of all row/col starts.  You will
> need to account for an offset here.  The clipping part is already
> handled on the other side, as I might not be able to draw the
> last row/col in full, so that code is there.
> ...

I guess I'm in over my head.  I've never worked in a C-based widget
before and TableDisplay is 800 lines long!  I can't grok it and I'm
sure it interacts with other code in ways I don't understand or
anticipate.  I don't mind doing the grunt work but I need an overview
and some direction.  Can Jeff or someone who has a bigger clue about
TkTable internals give me some guidance?  This is how I've started:

- Added a -scrollmode option in tkTable.c

- Added fields on the Table structure in tkTable.h to capture the
scroll info which is known in Table_ViewCmd() but, it seems, needed in
TableAdjustParams().

- Looked at TableAdjustParams() and considered that I think when I get
there and the scroll info indicates moving to a fraction of the height,
I need to compute:
.
.   topPixel = (tablePtr->rowStarts[tablePtr->rows-1] +
.                   tablePtr->rowPixels[tablePtr->rows-1]) * frac
.
At this point, I could store:
.
.   tablePtr->rowPixels[tablePtr->topRow] - topPixel
.
as an offset for displaying.  I think.

- Looked at TableDisplay() and given up 'cuz I don't see how to use
such an offset to adjust the display algorithm.

I fear that the right way to do this is to convert (rewrite?)
TableDisplay(), etc. to use pixels and then quantize pixels to the top
of a row or whatever elsewhere when I know what scrollmode I'm dealing
with.  That sounds touchy.

Feedback appreciated...

Chris


Report this thread to moderator Post Follow-up to this message
Old Post
Christopher Nelson
12-24-04 08:57 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Tcl archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:26 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.