[Gtk-sharp-list] combo widget

Roberto Díaz rdn@alu.ua.es
Fri, 12 Mar 2004 16:03:48 +0100


Hello,

I'm using Mono 0.30 and gtk-sharp 0.17 and I'm trying to compile this
code:

using System;
using System.Runtime.InteropServices;
using Gtk;
using GLib;

class ComboSample{
        Combo combo;
        OptionMenu opt;
        static void Main ()
        {
                new ComboSample ();
        }
        ComboSample ()
        {
                Application.Init ();
                Window win = new Window ("ComboSample");
                win.DeleteEvent += new DeleteEventHandler (OnWinDelete);

                GLib.List l = new GLib.List (IntPtr.Zero,
typeof(string));
                l.Append("hello");

                combo = new Combo ();
                combo.PopdownStrings = l;
                combo.DisableActivate ();
                combo.Entry.Activated += new EventHandler
(OnEntryActivated);
                                                                                                    
                win.Add (combo);
                win.ShowAll ();
                Application.Run ();
        }
}

I get on the line "combo.PopdownStrings = l" this error :

error CS0029: Cannot convert implicitly from `GLib.List' to `string[]'

I've seen on monodoc that combo.PopdownStrings accepts string input and
GLib.List input, right?

How can I put GLib.List inside Gtk.Combo?

any idea?

Best regards.

Roberto.