2010-07-09 173 views
1

我試圖從goocanvasmm中的Goocanvas :: Points實例獲取座標。我有這個:從Goocanvas獲取座標:: Points

double x = 0, y = 0; 
int i; 
Goocanvas::Points points; 
Glib::RefPtr<Goocanvas::Item> root = canvaswidget.get_root_item(); 
Glib::RefPtr<Goocanvas::Polyline> line = Goocanvas::Polyline::create(100, 100, 110, 120); 
root->add_child(line); 
points = line->property_points().get_value(); 
for (i = 0; i < 2; i++){ 
    points.get_coordinate(i, &x, &y); 
    printf("%f03, %f03", x, y); 
} 

應該工作。但是,當我嘗試編譯時輸出:

main.cpp: In function ‘int main(int, char**)’: 
main.cpp:21: error: no matching function for call to ‘Goocanvas::Points::get_coordinate(int&, double*, double*)’ 
/usr/include/goocanvasmm-0.1/goocanvasmm/points.h:82: note: candidates are: void Goocanvas::Points::get_coordinate(int, double&, double&) const 
make: *** [all] Error 1 

回答

1

你試過嗎?

points.get_coordinate(i, x, y); 
+0

哦。我以爲我有,但顯然不是。謝謝! – snostorm 2010-07-09 19:08:27