[gtkmm] Re: DrawingArea Dilema



Mike Eller wrote:

[...]

bool on_expose_event(GdkEventExpose*)
{
 Glib::RefPtr<Gdk::Window> win = get_window();

[...]

Compiling Error Message:
[mike mike playball]$ g++ main.cc -o main `pkg-config gtkmm-2.0 libglademm-2.0 --cflags --libs`
main.cc: In function `bool on_expose_event(GdkEventExpose*)':
main.cc:14: error: `get_window' undeclared (first use this function)

I am new to gtkmm, but I will give it a shot and try to help you anyway. Apparently, you are trying to access a non-static member function without an object and outside that member function's class' context. Here is an excerpt I took from the document "The Drawing Area Widget" [1]:

"The get_window() method is a part of the Gtk::Widget class, so if you put this code into a derived widget's implementation then you can call it just as it is, otherwise you'd use some_widget.get_window()."

[1] http://www.gtkmm.org/tutorial/sec-drawingarea.html

Regards,

--
Ney André de Mello Zunino




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