[pygtk] a widget like gimp's canvas

Arjan Molenaar arjanmolenaar at hetnet.nl
Wed Aug 4 22:56:27 WST 2004


Hi,

You should have a look at how Dia does this. It's C code alright, but it 
shows exactly what you want (don't know the class to look, probably 
lib/display.c). All I can remember is that it's pretty easy (in the end ;-).


Regards,

Arjan

Johannes Zellner wrote:

> On Wed, Aug 04, 2004 at 10:41:52AM -0300, Christian Robottom Reis wrote:
> 
>>On Wed, Aug 04, 2004 at 03:38:08PM +0200, Johannes Zellner wrote:
>>
>>>the rulers ARE the difficult part! w/o any rulers, it's easy.
>>>The painful thing is to size and scroll the rulers simulaneously
>>>with the drawingarea (which can be placed inside a scrolledwindow).
>>
>>Why not put rulers and canvas inside the scrolledwindow?
> 
> 
> because then the rulers will be scrolled away.
> I've attached an approach, which shows how it should look like
> (but which doesn't work correctly). There the drawingarea is
> about 600 x 400 pixels large, but the viewport is only about
> 280 x 280 pixels. Note that the rulers were scrolled correctly
> to match the visible part of the drawingarea (the rulers start
> at about 80 and not zero).
> 
> As I've said, the pygtk code which produced the screenshot
> doesn't work quite correctly and I thought that there must
> be already some code which does the job.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


More information about the pygtk mailing list