I’m trying to compile a gtkmm application that uses cairomm for drawing.
It compiles fine using gtkmm3.0 but when I try to compile it using gtkmm2.4 i get:
error: ‘signal_draw’ was not declared in this scope
I’m using g++.
It seems that there is no signal_draw in gtkmm2.4(Am I wrong?). Is there any function/signal that can be used instead?
Thanks in advance.
Sorry for my bad English.
Some code:
class egclass: public Gtk::DrawingArea
{
public:
egclass();
virtual ~egclass();
virtual bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr);};
egclass::egclass()
{
#ifndef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
signal_draw().connect(sigc::mem_fun(*this, &egclass::on_draw), false);
#endif
}
The older gtkmm 2.4 has on_expose_event instead:
If you need to create a cairo context for drawing, with the GTK+ C API it goes something like this:
… translating the snippet above to gtkmm is left as an exercise to the reader.
Also see the following links: