Is it possible to pointer pointer access class member?

Asked

Viewed 34 times

0

I’m starting a Gtkmm app with Glade. I want to put all event handling functions in a separate class from which the Glade file is being instantiated. Following the example of the book Programming with Gtkmm 3 in the section Glade and Gtk::Builder, I can easily display the window. The problem occurs when I try to access a member of the class using Glade in the event handler class.

Follow the classes:

gtimer-Gui. h

inserir a descrição da imagem aqui

gtimer-Gui.cpp

inserir a descrição da imagem aqui

main.cpp

inserir a descrição da imagem aqui

gtimer-controller. h

inserir a descrição da imagem aqui

gtimer-controller.cpp

inserir a descrição da imagem aqui

When trying to access the p_new button to link the event handler I get the following message:

request for Member 'p_new' in 'gtimergui' which is of Pointer type 'Gtimergui' (Maybe you Meant to use ' -> ' ?)

What may be going wrong if I am already using the correct symbol to manipulate members of a pointer?

1 answer

0

I was able to resolve the situation with a feedback on the gcc.gnu.org website. It seems that it was a compiler bug that sent the wrong message: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91138

Of: gtimergui->p_new->signal_clicked(). connect(sigc::mem_fun(this, &Gtimercontroller::Temporized));

I switched to: (*gtimergui)->p_new->signal_clicked(). connect(sigc::mem_fun(this, &Gtimercontroller::Temporized));

Browser other questions tagged

You are not signed in. Login or sign up in order to post.