views:

579

answers:

1

I've recently started playing with Mono (1.9.1) on Ubuntu 8.04 with the Mono-Develop IDE (v1). I am attempting to use GTK-Sharp 2 to run the GUI for the play apps.

For some reason when I try to create gtk dialogs (ColorSelectionDialog or MessageDialog) the compiler throws the error "'Gtk.ColorSelectionDialog.ColorSelectionDialog(GLib.GType)' is inaccessible due to its protection level(CS0122)"

Perhaps these dialogs are not public objects in the GTK Libary? You would think they would be.

Here is a sample of some c# code that throws the exception:

Gtk.ColorSelectionDialog dlg = new Gtk.ColorSelectionDialog(); //dont need any more than this

Any suggestions?

+2  A: 

Found a solution. Can't use the default constructor with no arguments. For some reason this constructor just doesn't work. If it's called like such:

MessageDialog md = new MessageDialog (parent_window, DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Close, "Error loading file");

Then it works ok. Obviously something is buggered up somewhere, but I don't have the technical know how to figure out how to fix the underlying problem in either Gtk or Mono.