[gnomemm] Gnome Item Coordinates



Hi,

We are currently developing an application using gnomemm 2.0.
We have created the application as follows:

1. We have created a canvas of type Gnome::Canvas::CanvasAA.
2. we have created a new group from the root group
3. To this group we have added a  Gnome::Canvas::Rect and few
Gnome::Canvas::Line items. The idea is to create a "table" with rows and
columns.

3. We have connected a signal event to the group.

We want the "table" (rect and lines) to be resized on certain event. Hence,
in the signal handler,
We create the GnomeCanvasGroup pointer and traverse the
GnomeCanvasGroup::item_list.
To access the individual items in the group we type cast them to their
repective Item class using Glib::wrap() method.

The problem we are facing is that, after type casting we are geting the
coordinates of  the rect (double) properly. But when we try to get the
coordinates of the line, via Gnome::Canvas::Points,
we do not get any values in it. Gnome::Canvas::Points::is_null returns true
for the Points object obtained for
the line.

Can anyone help us with this problem?

Thanking you


Attached is the code snipet:
GnomeCanvasGroup *mygp = gp->gobj ();
GList *temp = mygp->item_list;
Gnome::Canvas::Line * l =
* Glib::wrap (((GnomeCanvasLine *) (temp->data)),true);
  l->property_fill_color () = "red";

  Gnome::Canvas::Points pts(2);
  pts = l->property_points().get_value();

Regards,
Deepak



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