How to create combobox with images in gtk?

Can someone tell me how to create a combo box, for example, with Gtk (on Linux)? (I already asked this question for win32 API).

alt text

Sample code or tutorial will be very helpful. I tried to find this over the Internet, but unfortunately the documentation / tutorials are not so rich for Gtk. Thank you very much.

Hello,

+3
source share
1 answer

I know how to do this in C, but I will try to do it in C ++. First of all, use ComboBox to display your menu, which you will fill using TreeModel .

Create a TreeModelColumnRecord , following the example here ; you only need one Gdk::Pixbuf column to display your line images.

Pass the TreeModelColumnRecord constructor. Fill ListStore Gdk::Pixbuf images of your line patterns and pass this to the constructor of your ComboBox ( ListStore inherits from TreeModel ).

+1
source

All Articles