Re: Gnome canvas



Eric Laeuffer <laeuffer cybercable fr> writes:

> Hi,
> 
> I still have some problems with canvas. I will try to explain exactly
> what is my problem.
> 
> I created a windows which contains just a canvas and I set the scroll
> region to 600x300. In this canvas I put in the root group a rect item
> which should be the canvas background.
> And then I catch all events (canvas, group, and rect item events) and I
> displays with printf the cursor position which is returned by
> event->cursor.x and event->cursor.y. This coordonates are, according to
> the GGAD, the world coordonates of the widget.
> This coordonates are the same for all the events I catched.
> 
> But when I resize the windows and when the windows size is bigger than
> my scroll region (600x300) the rect item comes to the windows center.
> And know, it seems that the cursor returns bad cursor position. The
> canvas event return a position where 0,0 is the top left position off
> the windows and the group and rect item return a position where 0,0 is
> the top left of the rect item. In this case I expected to have for all
> events the same coordonates like in the previous exemple. 
> Is it a normal situation ? Can you explain me that ?
> 
> I would like that the items I will add to the canvas stays at the top of
> the windows when I resize it. Is it possible and how can I do that ?
> 
> And my last question is, how can I resize my background rect item to fit
> the windows size ?

hm. you might have a look at nautilus/libnautilus-extensions/nautilus-background.c 
(nautilus_background_set_up_canvas)

the comments explains why we did the above hack and did not tried to use a 
background item.

And, yes: it is evil :)

Mathieu

> 
> 
> I am sorry, I am a newbie :))
> Thank you
> -- 
> Eric Laeuffer
> laeuffer cybercable fr
> 
> _______________________________________________
> gnome-devel-list mailing list
> gnome-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-devel-list

-- 
Mathieu Lacage <mathieu eazel com>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]