0

Can give me someone an idea how I can switch of the antialiasing for all items in a goocanvasmm?

I tried to get the root item model but this did not contain the antialiasing property.

I could not really find any valid documentation for goocanvasmm. I really need a tutorial but I can't find some.

[edit] Sorry, I need the code for goocanvasmm!!! not goocanvas. So please do not edit this again. Yes, it is the c++ version of gtk+ called gtkmm and the goocanvasmm

[edit] I have now a rect in the canvas and I could get the rect->property_antialias()=???? but now i struggled with PropertyProxy.

the following both lines will not work: 1)

rect->property_antialias()=CAIRO_ANTIALIAS_NONE ;

no match for »operator=« (operand types are »Glib::PropertyProxy« and »_cairo_antialias«)

2)

rect->property_antialias()=ANTIALIAS_NONE ;

error: 'ANTIALIAS_NONE' was not declared in this scope

Thanks!

liberforce
  • 11,189
  • 37
  • 48
Klaus
  • 24,205
  • 7
  • 58
  • 113

1 Answers1

1

GooCanvaItemSimple is the base class for most items. It has an antialias property which is of a type that maps to cairo_antialias_t.

This is for the C version, not C++, but it should be easy to map to the 'mm' versions of the docs. Here's the equivalent for antialias in goocanvasmm.

When you don't know where a property is, just dig in the parent classes or interfaces implemented until you find it.

Then, set the value of the appropriate Cairo::Antialias type (which is a type defined in cairomm).

rect->property_antialias() = Cairo::ANTIALIAS_NONE;
liberforce
  • 11,189
  • 37
  • 48
  • OK, I could something like rect->property_antialias()=???? but now i struggled with PropertyProxy. I can't set a enum value from cairo directly. How to convert to the proxy? – Klaus Jan 03 '14 at 14:52
  • See my last edit in my question. I added the two lines I tried. – Klaus Jan 03 '14 at 15:05
  • If you're not using the Cairo namespace, you have to specify the full path to the data: [`Cairo::Antialias::ANTIALIAS_NONE`](http://cairographics.org/documentation/cairomm/reference/namespaceCairo.html#a2cb381e7f63bef767a7d697fc5af13b4) I guess (or `Cairo::ANTIALIAS_NONE`, can't remember). – liberforce Jan 03 '14 at 15:25