ComboBox works exactly like TreeViews

Here is a code snippet from a custom ComboBox I made.

// this class is inherited from ComboBox BUT this can be done EXACTLY the
same way without it.
// The only difference is the ComboBox variable would be before all the
calls
store = new ListStore( typeof(string), typeof(string), typeof(bool) );
RowSeparatorFunc += (TreeModel model, TreeIter iter ) => {
return (bool)model.GetValue(iter,2);
};
CellRendererPixbuf pic = new CellRendererPixbuf();
PackStart( pic, false );
AddAttribute( pic, "stock-id", 0 );
CellRendererText text = new CellRendererText();
PackStart( text, false );
AddAttribute( text, "text", 1 );
Sensitive = true;
Model = store;

If you want to know more about TreeViews go
here<http://www.mono-project.com/GtkSharp_TreeView_Tutorial>
.

On Thu, Jul 29, 2010 at 2:51 PM, Claudio Rocha de Jesus <
[email protected]> wrote:

> Hello everyone,
> recently started programming using GTK #, and my question is how do I make
> a data connection in gtk.combobox?
>
> Thanks
> _______________________________________________
> Gtk-sharp-list maillist  -  [email protected]
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>
>
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to