信号signal_switch_page()不起作用

时间:2017-01-09 01:46:16

标签: c++ gtkmm gtkmm3

您好我使用库Gtkmm时遇到问题。我已经定义了一个

public class AuthenticationBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse>
{
    public Task<TResponse> Handle(TRequest request, RequestHandlerDelegate<TResponse> next)
    {
        //Can't access handler class here, so how do I know the action requires authentication/authorization?
        return next();
    }
}

[Authorize]
public class ChangePasswordRequestHandler : IAsyncRequestHandler<ChangePassword, ReponseType>
{   
    protected override async Task<ReponseType> Handle(AsyncRequestBase<ChangePassword> message)
    {
        //change users password here
    }
}

但我的信号有问题

Gtk::Notebook notebook;
实际上这个信号不起作用。有什么建议吗?

1 个答案:

答案 0 :(得分:0)

signal_switch_page的原型是void on_my_switch_page(Widget* page, guint page_number)所以正确的语法是:

notebook.signal_switch_page().connect([this](Gtk::Widget* page, guint page_number){
            std::cout << "It works !" << std::endl;
        });