问题描述
我对图形编程并没有真正的经验,但我很好奇。我在 Debian 10.7 机器上安装了 libgtk-3-dev 和 gtk-3-examples。从那里我使用 dpkg-query -L gtk-3-examples
列出了示例包文件以查找一些示例程序。
在示例目录中,我找到了以下 README 文件:
== Building the examples ==
The examples in this directory are built alongside the rest of GTK+.
The examples under the `application[1-10]` directories are also included in
the GTK+ API reference documentation,and can be built independently,using
the system libraries,by doing:
$ cd application1
$ make -f Makefile.example
看起来很直接。但是,按照指示完全会产生以下结果:
make: Makefile.example: No such file or directory
make: *** No rule to make target 'Makefile.example'. Stop.
应用程序文件夹中没有“Makefile.example”文件。在示例目录中运行 find -name "Makefile*"
会产生:
./application7/Makefile.in.gz
./application7/Makefile.am
./Makefile.in.gz
./application5/Makefile.in.gz
./application5/Makefile.am
./bp/Makefile.in.gz
./bp/Makefile.am
./application9/Makefile.in.gz
./application9/Makefile.am
./application6/Makefile.in.gz
./application6/Makefile.am
./application2/Makefile.in.gz
./application2/Makefile.am
./application10/Makefile.in.gz
./application10/Makefile.am
./application3/Makefile.in.gz
./application3/Makefile.am
./application1/Makefile.in.gz
./application1/Makefile.am
./application8/Makefile.in.gz
./application8/Makefile.am
./application4/Makefile.in.gz
./application4/Makefile.am
./Makefile.am
我没有运气使用上述文件构建示例程序。我猜是因为我不熟悉汽车工具?是否有一种简单的方法可以使用上述文件构建示例 GTK 程序,或者我是否需要了解更多有关 make/autotools/configure 的知识才能运行工作示例?
更新:
cant-run-makefile-am-what-should-i-do 帖子提供信息,但不提供在包中找不到配置、引导程序或自动生成程序时的操作过程。在我的示例目录中执行以下命令时不会产生任何结果:find -type f | grep -i -E "*conf*|*auto*|*boot*"
。我需要提供其中一个文件才能成功构建(据我所知)。
解决方法
抱歉打扰了!我习惯于安装常规软件包,但我错过了需要下载完整的源代码才能使示例正常工作。所以,最初我提到我安装了 libgtk-3-dev 和 gtk-3-examples。我是使用 onFilterInvoices: function(oEvent) {
// build filter array
var aFilter = [];
var sQuery = oEvent.getParameter("query");
if (sQuery) {
aFilter.push(new sap.ui.model.Filter({
path: "pos",test: function(oValue) {
var oMaterials = oValue;
for (var i in oMaterials) {
if (oMaterials[i].materialDesc === sQuery) {
return true;
}
}
return false;
}
}));
}
// filter binding
var oList = this.getView().byId("listapp");
var oBinding = oList.getBinding("items");
oBinding.filter(aFilter);
}
这样做的。
但是,要在本地构建 GTK 及其示例,看起来您想要做的是使用 apt-get install libgtk-3-dev && apt-get install gtk-3-examples
(或类似的...当我运行该命令时)。
然后,在我的新 gtk+3.0-3.24.5 目录中有一个很好的 configure 二进制文件,我可以运行它(随后的 apt-get source gtk-3-examples
和 {{ 1}} 命令)产生许多文件,包括示例程序二进制文件。
因此使用 make
我得到了一个运行示例。瞧!