![]() | ![]() | ![]() | Libmergeant Reference Manual | ![]() |
---|
MgGraphItem — Parts of data model used with the MgGraph object.
struct MgGraphItem; guint mg_graph_item_get_type (void); GObject* mg_graph_item_new (MgConf *conf, MgBase *ref_obj); MgBase* mg_graph_item_get_ref_object (MgGraphItem *item); void mg_graph_item_set_position (MgGraphItem *item, gdouble x, gdouble y); void mg_graph_item_get_position (MgGraphItem *item, gdouble *x, gdouble *y);
Each graph item which needs to have its position kept in the MgConf object (and written in the dictionnary file) has a corresponding MgGraphItem object. A graph item can hold a reference to any MgBase object, meaning that the position it stores is the position where the references object's graphical representation will be on the canvas.
GObject* mg_graph_item_new (MgConf *conf, MgBase *ref_obj);
Creates a new MgGraphItem object
MgBase* mg_graph_item_get_ref_object (MgGraphItem *item);
Get the referenced MgBase object, if it exists.
item : | a MgGraphItem object |
Returns : | the referenced object, or NULL |
void mg_graph_item_set_position (MgGraphItem *item, gdouble x, gdouble y);
Sets the position to be remembered for item.
item : | a MgGraphItemItem object |
x : | |
y : |
void mg_graph_item_get_position (MgGraphItem *item, gdouble *x, gdouble *y);
Get item's position.
item : | a MgGraphItemItem object |
x : | a place where to store the X part of the position, or NULL |
y : | a place where to store the Y part of the position, or NULL |
void user_function (MgGraphItem *mggraphitem, gpointer user_data);
mggraphitem : | the object which received the signal. |
user_data : | user data set when the signal handler was connected. |
<< MgGraph | MgCanvas >> |