GnomeCanvas



Hello,

Yesterday I tried to understand the GnomeCanvas and I looked into the
sources of gnumeric, gnomecal and testgnome. While sneaking through
the code I got a few ideas and a few questions:

1.) What about a highlight function, that will highlight the item in
the near of the cursor. I figured out that you call the (point)
function to determine the nearest item whithe every mouse move.	I´m
not sure if this can be done via the drawable of the (draw) function,
or a new (highlight) function, which will copy most of the (draw)
algorithm. 
And naturally a flag, whether this item should be highlighted or not.

2.) In the gnumeric it is very difficult to hit the cursor or a circle 
with a mouse click. Although I have seen, that e.g the item_grid
installs an event handler that catches all events, and filters the
right mouse click to display an context sensitive menu. 

What if an item installs a "menu) function in the GnomeCanvas and the
canvas calls this function for all objects in the near of the
cursor. Like in glade, you would be able to select the other item,
without a hassle. e.g. The menu would could look like:

  line1  ->
  line2  ->
  circle -> 
  rect   ->
  cursor ->
  ---------
  cut
  paste
  ...

- While traversing the menu, the items could highlight to give a
  visual feedback. 
- Selecting only an item (e.g like circle) while set the circle as the 
  current selection

3.) Wouldn´t the functionality of the Stipples in gnumeric be better
    placed into GnomeCanvas?

4.) Is the GnomeCanvas thought as an all purpose Canvas, or is it
thought as a spezialiced drawing widget? E.g. am I able to insert a baboon
object within the canvas, to build up a document processor?

5.) Is somebody working on the spline interpolation in the
gnome-canvas-line item? I would like to do this. I thought about
computing the interpolated pixels within the realize phase and to hold 
a second list of GnomeCanvasPoints within the GnomeCanvasLine
structure.

6.) Is it possible to build up a generic widget from the item arguments, 
so that one can change the arguments from a properties entry in the
right click menu. The generic widget could be replaced by the item
programmer with a specialized widget.

7.) Last but not least a question about inheritance: What if I would
like to produce a small drawing application with lines, circles,
rectangles, polygons and variable fill style, line width, color? 

If I want to change the properties of the item I want to have a
notebook dialog with e.g three tabulators: 
<line style> <fill style> <other> 

Naturally various items in my drawing application have various properties.
But all properties belong at least within a few classes. Now I´m
thinking in the objective-c way and would like to say a line conforms
to the line_style protocol, that means it implements all arguments to
change the line style. Then I´m able to write a custom widget to
change the line style and to insert this widget in the properties
notebook line style page. Do you understand what I mean?

I do not understand the whole GtkObject way of arguments and neither
have a deep inside knowledge about all that Object Oriented stuff in
Gtk+ and Gnome. But wouldn´t it be better to use argument names like:

GnomeCanvasItem::Fill::color instead of GnomeCanvasLine::fill_color
                                        GnomeCanvasRE::fill_color


Ok, thats all. 

Keep up the good work
Dirk



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