c - Gtk:GtkVPaned 二胎高度

标签 c gtk

有什么方法可以让 GtkVPaned 设置分割器位置,以便第二个 child 的高度为 100px 吗?

谢谢。

最佳答案

如果您有一个 GtkVPaned 并且已经向其中添加了两个小部件,如下所示应该可以工作:

GtkVPaned *vpane = ...;

// set up stuff here

int pos = ;// calculate correct position here, easy if you know the height already
g_object_set(vpane, 
            "position", pos,
            "position-set", TRUE); 

如果您不知道区域的高度,事情会变得更加困难,那么您实际上必须将 VPane 添加到您想要的任何位置,确保布局发生然后询问高度。

关于c - Gtk:GtkVPaned 二胎高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5484962/

相关文章:

c - 返回 DMA 地址的结构指针

c - __try 和 __exception 可移植性

c - C 中的管道和 fork

c - 如何从 GtkFileChooserDialog 获取选择的文件?

python - 设置 Gtk.ComboBoxText 默认项?

c++ - 如何获取程序路径

c++ - 使用 gdbus-codegen 生成的代码时如何堵塞内存泄漏?

c++ - 将 FORTRAN 转换为 C/C++

c++ - 如何禁用 GTK 拖放?

c++ - GTK 绘图时闪烁