GRaSourceからメインアプリケーションウィンドウのリソースを読み込む、Vala(非動作ソースツリーhere)で書かれた非常に基本的なGTKアプリケーションがあります。複合テンプレート用のリソースを読み込めません
リソースファイルを作成し、glib-compile-resources
でコンパイルし、VALAFLAGS
に--gresources=$(top_srcdir)/data/gauthenticator.gresource.xml
と追加しました。
データファイルの関連部分は次のようになります。
<gresource prefix="/eu/polonkai/gergely/gauthenticator">
<file preprocess="xml-stripblanks">gauth-window.ui</file>
</gresource>
と私はこのようにそれを使用します。
[GtkTemplate (ui = "/eu/polonkai/gergely/gauthenticator/gauth-window.ui")]
class Window : Gtk.ApplicationWindow {
[GtkChild]
private Gtk.ProgressBar countdown;
}
私Makefile.am
の関連部分:
gresource_file = $(top_srcdir)/data/gauthenticator.gresource.xml
gauthenticator_VALAFLAGS = --pkg gtk+-3.0 --target-glib=2.38 --gresources $(gresource_file)
コンパイル中はすべて正常ですが、実行時にこのエラーが発生します:
(gauthenticator:16501): Gtk-CRITICAL **: Unable to load resource for composite template for type 'GAuthenticatorWindow': The resource at '/eu/polonkai/gergely/gauthenticator/gauth-window.ui' does not exist
(gauthenticator:16501): Gtk-CRITICAL **: gtk_widget_class_bind_template_child_full: assertion 'widget_class->priv->template != NULL' failed
(gauthenticator:16501): Gtk-CRITICAL **: gtk_widget_init_template: assertion 'template != NULL' failed
ほとんどのリソース関連の行はGNOME Boxesリポジトリからコピーされましたが、明らかに何かが見つかりませんでした。