Pixelbuffer to draw on a surface
TheDGuy via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Dec 4 09:57:02 PST 2015
Thanks for your answers. I think Cairo is the right way but i
have a hard time to translate any of those C++ or Python
tutorials to D, my current code:
import gtk.Main;
import gtk.MainWindow;
import gtk.DrawingArea;
import gdk.Cairo;
import gtk.Widget;
void main(string[] args){
Main.init(args);
MainWindow win = new MainWindow("Tutorial");
win.setDefaultSize(250,250);
win.add(new MyArea());
win.showAll();
Main.run();
}
class MyArea : DrawingArea
{
this(){
}
bool on_draw(){
return true;
}
}
I tried to work with this Python tutorial (i think Python is
easier to read than C++):
http://www.tortall.net/mu/wiki/PyGTKCairoTutorial
but if i try to do this: "cr = self.window.cairo_create()" i get:
"No property Window for type main.Area"?
More information about the Digitalmars-d-learn
mailing list