Jacob Sánchez
Jacob Sánchez

Reputation: 459

Setting icon in GTK#2 fails with MissingMethodException

This is my first time using MonoDevelop, I want to add at icon to a new project, in C# with Gtk# 2.0. Everything is fine until adding an icon either via stetic or directly in the code, as below:

public partial class MainWindow : Gtk.Window {

    public MainWindow() : base(Gtk.WindowType.Toplevel) {
        this.Icon = new Gdk.Pixbuf(System.Reflection.Assembly.GetEntryAssembly(),
                        "Icon.png", 32, 32 );
        this.Build();
    }
    ...
}

enter image description here

Upvotes: 1

Views: 45

Answers (1)

Jacob Sánchez
Jacob Sánchez

Reputation: 459

After some time to think and inspiration from this post, I managed to solve the problem. It all had to do with uninstalled bindings for gdk. I'm not entirely sure which did the trick, but the list of the ones I installed is the following:

  • libghc-gi-gdkx11-dev
  • libghc-gi-gdk-dev
  • libgtk3.0-cil-dev
  • libwmf0.2-7-gtk
  • libghc-gi-gdkpixbuf-prof
  • libghc-gi-gdkpixbuf-doc
  • libghc-gi-gdkpixbuf-dev

The one in bold is the one I personally think did the trick.

Upvotes: 1

Related Questions