Re: gnome canvas sluggish with GDK_MOTION_NOTIFY



The problem seems to reside in the amount of time it takes to repaint a gnomecanvasitem.  In my event handler I have the following:


  project(x,y,&lat,&lon);
  
  
  sprintf(buf,"Lat: %f",lat);
  gnome_canvas_item_set(iframe.lat,
			"text",buf,
			NULL);
  
  sprintf(buf,"Lon: %f",lon);
  gnome_canvas_item_set(iframe.lon,
			"text",buf,
			NULL);
  sprintf(buf,"x: %.0f",dx);
  gnome_canvas_item_set(iframe.x,
			"text",buf,
			NULL);
  sprintf(buf,"y: %.0f",dy);
  gnome_canvas_item_set(iframe.y,
			"text",buf,
			NULL);
  
  
  sprintf(buf,"Error: %.0f ft",determine_error_ft());
  gnome_canvas_item_set(iframe.error,
			"text",buf,
			NULL);
  
  
  g_assert(-90 <= lat && lat <= 90);
  g_assert(-180 <= lon && lon <= 180);

The interesting thing is, in some canvas configurations this is fast engouhg, in others this is not and the mouse movement is sluggish.


Thanks,
Andrej


On Mon, Feb 05, 2001 at 06:03:02PM -0500, Havoc Pennington wrote:
> 
> 
> Andrej Andrejko <ai heavy-ind com> writes:
> > 
> > I am using the gnome canvas heavily to develop a georeferencing application.  I have many nested groups on the canvas and I am finding that mouse movement piles up events.  The more groups I have  the more sluggish the mouse movement becomes.  Are there any tricks I can use to speed this up?  I anticipate having as many as 100 groups on the canvas at one time.  
> > 
> > I am using gnome-libs 1.2.4.
> > 
> 
> Read the "scribble" example in the GTK tutorial on www.gtk.org for how
> to avoid this. (use POINTER_MOTION_HINT_MASK instead of
> POINTER_MOTION_MASK.)
> 
> Havoc
> 
> _______________________________________________
> gnome-devel-list mailing list
> gnome-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-devel-list




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