本文介绍了如何使用C ++在gtkmm:gtk :: Listbox中添加文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在c ++中使用Gtkmm在列表框中添加这种类型的文本.

I want to add this type of text in Listbox using Gtkmm in c++.

请问有什么方法可以建议我吗?

Can you suggest me any way how to do it, please?

推荐答案

对于这种非常简单的情况,您可能需要使用gtkmm的ListViewText小部件: https://developer.gnome.org/gtkmm/stable/classGtk_1_1ListViewText.html

For this very simple case, you might want to use gtkmm's ListViewText widget:https://developer.gnome.org/gtkmm/stable/classGtk_1_1ListViewText.html

这是一些示例代码: https://git.gnome.org /browse/gtkmm-documentation/tree/examples/book/treeview/listviewtext/examplewindow.cc

Here is some example code:https://git.gnome.org/browse/gtkmm-documentation/tree/examples/book/treeview/listviewtext/examplewindow.cc

但是,如果您想做更复杂的事情,则需要使用完整的Gtk :: TreeView类.

However, if you want to do anything more complex, you'd need to use the full Gtk::TreeView class.

我认为Gtk :: ListBox不适合提供这样的简单值列表.实际上,您可能想使用Gtk :: ComboBox-甚至可能是简单的Gtk :: ComboBoxText小部件: https://developer.gnome.org/gtkmm/stable/classGtk_1_1ComboBoxText.html

I don't think Gtk::ListBox is appropriate for offering a simple list of values like that. In fact, you might want to use Gtk::ComboBox - maybe even the simple Gtk::ComboBoxText widget:https://developer.gnome.org/gtkmm/stable/classGtk_1_1ComboBoxText.html

这是一些Gtk :: ComboBoxText示例代码: https://git.gnome.org /browse/gtkmm-documentation/tree/examples/book/combobox/text/examplewindow.cc

Here is some Gtk::ComboBoxText example code:https://git.gnome.org/browse/gtkmm-documentation/tree/examples/book/combobox/text/examplewindow.cc

这篇关于如何使用C ++在gtkmm:gtk :: Listbox中添加文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 06:16