Questions about drawables and colors



Hi gtkmm list

I'm kinda new to gtkmm, but it seems really good. I run 2.4 rpm installation and it seems to work.

I've got some questions concerning drawables (i use a drawing area). I find the docs a bit confusing when it comes to colors and colormaps. Dont know if i missed something vital...

The first question is how I change the color when drawing primitives. I have managed to draw stuff using the default foreground color, but suppose I want a red and a blue rectangle on my drawing area. I've looked at the example code, but it seems to be for an earlier verion of gtmm, because it wont compile. I've fiddled alot with this but can't get it to work.

Second thing is how to change the background color to, for instance, white. I've tried to put some different stuff in the configure event, but it didn't work. Guess it's the same problem as the above question.

Last but never least would be how to invert the color of a section of a drawable. The best thing would be to grab the content already drawn to it, and invert but if that's not possible, I could draw it again but inverted. Prob is I don't know how to do that...

Thanks in advance!

/Johan



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