2012-06-14 37 views
1

以下错误消息是代码..的gtkmm - GTK从:: appchooserdialog

Glib::RefPtr<Gio::File> file = Gio::File::create_for_path(filepath); 
Gtk::AppChooserDialog *dialog = new Gtk::AppChooserDialog(file, *this); 

if (dialog->run() == Gtk::RESPONSE_OK) { 
    Glib::RefPtr<Gio::AppInfo> appinfo = dialog->get_app_info(); 
    appinfo->launch(file); 
} 
dialog->hide(); 

这是消息在执行上面的代码时,我得到..

glibmm-WARNING **: Glib::ConstructParams::ConstructParams(): object class "gtkmm__GtkAppChooserDialog" has no property named "file" 

我可能在这里犯了一个愚蠢的错误。谁能帮我这个?在此先感谢..

回答

0

那么,在gtk-3.0中,没有名为“文件”的GtkAppChooserDialog属性,但有一个名为“gfile”的属性。这似乎是gtkmm wrapping中的一个错误,其中“file”在适当的_CONSTRUCT()调用(当前是第38行和第44行)中应该是“gfile”,但我没有足够的包装理解来确保。如果这是问题,我没有看到一个简单的解决方法,没有修补gtkmm。

更新:在包装中是a bug