Drawing on a DrawingArea without using polymorphism



Hi there !

I'd like to draw a line on a drawing area.
I succeeded by creating a subclass of DrawingArea and overriding the
on_expose_event() method... but I no longer want to use this behaviour.
So I used signals in order to delegate this task :

<code>
Gtk::DrawingArea* mainDrawingArea;
// Initializing my drawing area...
mainDrawingArea->signal_expose_event().connect(sigc::ptr_fun(&
SignalsLinker::drawMainArea));
</code>

Then, implementing drawMainArea() :
<code>
bool SignalsLinker::drawMainArea(GdkEventExpose *event){
	 printf("Draw !\n");
}
</code>

The "draw" is successfully displayed !
Now, what I'd want to know, is the way of retrieving my concerned
DrawingArea in order to gather the corresponding Window object and draw
lines on it .. is it possible ?
(note : I won't have any pointer on my DrawingArea in my SignalsLinker class
... wouldn't it be possible to retrieve it with the GdkEventExpose object
given ?)

Thanks in advance ;)
-- 
View this message in context: http://www.nabble.com/Drawing-on-a-DrawingArea-without-using-polymorphism-tf2293533.html#a6371225
Sent from the Gtkmm mailing list archive at Nabble.com.




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