问题描述
我想将使用gtk2用c编写的示例程序传输到gtk3。该示例显示了gtk_scrolled_window和gtk_vieport的用法。焦点集中在两个gtk函数的属性上,当收缩主窗口时,滚动gtk-scrolled_window小部件时,换句话说,当我滚动到gtk_scrolled_window-widget和gtk_viewport-widget的相同部分时,它们是可见的gtk_scrolled_window,gtk_viewport小部件也会自动滚动。唯一的问题是不能将主窗口缩小。不能使其小于gtk_viewport中完整显示的gtk_grid。因此,滚动是多余且不可能的。如果我不将gtk_viewport放在gtk_Box中(通过用gtk_Box_pack_start注释掉该行(GTK_Box(vBox),viewport,TRUE,TRUE,0);),则可以缩小主窗口。 gtk_widget_set_hexpand(...,FALSE)没有帮助。 奇怪的是,该程序在gtk2下运行;但是,我进行了更改,因为该程序的某些部分不再受gtk3支持或已弃用。例如,gtk_table被gtk_grid代替。 该程序来自 安德鲁·克劳斯(Andrew Krause) GTK +开发的基础
有人知道吗?
环境:Linux openSUSE LEAP 15.0 64位 内核版本4.12.14-lp150.12.48-sefault 处理器4 x Intel Core i5-3450 cpu 3.10 GHz gcc版本7.5.0(SUSE Linux)
有人知道吗?
链接命令:
gcc -Wall -g scrolledwindows.c -o scrolledwindows possiblePrimeCounter = 0;
for(int intIndextocheck = 0; intIndextocheck < listofPrimes.size(); intIndextocheck++) {
if(atNum % listofPrimes.get(intIndextocheck) !=0) {
possiblePrimeCounter++;
if(possiblePrimeCounter == listofPrimes.size()) {
//We then add this number to the list of primes.
listofPrimes.add(atNum);
possiblePrimeCounter = 0;
}
} else {
break; // Not prime
}
}
pkg-config --cflags gtk + -3.0
阿齐姆
pkg-config --libs gtk + -3.0
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)