views:

26

answers:

1

Hi !

Can anyone please tell me how to create a combobox like following with Gtk (on Linux)? (I already ask this question for win32 API).

alt text

A code example or tutorial will be very helpful. I have tried searching this over the internet, but unfortunately documentations/tutorials aren't that much rich for Gtk. Thank you very much.

Regards,

+1  A: 

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

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

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

ptomato
Thank you very much. I'll try it, though I'm not sure I got all those :) Btw, in any chance if you have an example please be kind enough to show it to me (C or C++). Thanks again.
Morpheus