[pygtk] R: Re: Info neded : DrawingArea

euro_ii at libero.it euro_ii at libero.it
Mon Jul 13 23:31:58 WST 2009


>With a lot of programming it should be possible in some way.
could you show me 
the right way to approch the problem ? 
creating custom gtkobject ..

>yes, 
connect to mouse tracking, when a coordinate comes near a line (which you 
>can 
find in your data), switch the colour of the line, and mark it as dirty so 

>the system will redraw it.
>when the coordinate moves away from the line, 
switch the color back, and mark 
>it as dirty again so the system will redraw 
the line in original colour.

How can I mark the entity as dirty ?

Thanks

Matteo


>----Messaggio originale----
>Da: a.t.hofkamp at tue.nl
>Data: 13/07/2009 
16.28
>A: "euro_ii at libero.it"<euro_ii at libero.it>
>Cc: "pyGtkMailingList"
<pygtk at daa.com.au>
>Ogg: Re: [pygtk] Info neded : DrawingArea
>
>euro_ii at libero.
it wrote:
>> Hi Guys,
>> I have 3 question.
>> 1)
>> It's possible to crate 
custom widgets like 
>> edittext inside the drawingArea attached to the mouse 
pointer so when i move 
>> the mouse in the drawingArea the edit text follow 
the mouse and when i type 
>> some keyboar key the values gose directly in to 
the edit text?
>
>With a lot of programming it should be possible in some way.

>
>> 2)
>> It's possible 
>> to attach an event like mouse doubleclick at a 
line created with the .....
>> window.draw_line(.  function. ?
>
>yes, connect 
to the mouse clicks, when receving one, find out which line the 
>user clicked 
on in your data, switch the colour of that line (and switch all 
>other lines 
back to their original colour), mark the area of all changed lines 
>as dirty, 
so the system will redraw that part of the canvas.
>
>> 3)
>> It's possible to 
make a sort of highlight on 
>> the entity in the DrawingArea so when i move 
the mouse over the  line the line 
>> change the color?
>
>yes, connect to 
mouse tracking, when a coordinate comes near a line (which you 
>can find in 
your data), switch the colour of the line, and mark it as dirty so 
>the system 
will redraw it.
>when the coordinate moves away from the line, switch the color 
back, and mark 
>it as dirty again so the system will redraw the line in 
original colour.
>
>
>The DrawingArea is just like a piece of paper. It has no 
idea what you draw on 
>it, and it doesn't keep record.
>If you want to have 
nice interactive effects, you will have to program yourself.
>
>Sincerely,

>Albert
>




More information about the pygtk mailing list