[MonoDevelop] Stetic generates GUI code with errors

Jacek Rużyczka stacheldraht at interia.pl
Thu Jan 1 16:12:34 UTC 2015


Hi folks,

after a system upgrade (openSuSE 13.2) I also received a new copy of MD
(ver. 5.5-117.2) running against Mono 3.10.0-149.10. I took my old
projects (made with MD 4 so far) and ported tham into MD 5 project
format. After some work I realized that one of my GUI classes (a
Gtk.Dialog) would not compile anymore due to numerous errors in the
generated GUI code. Here's and excerpt of the error list:

/home/jacek/Documents/Projects/iwawi/iwawi/gtk-gui/iwawi.tools.AboutDialog.cs(23,23): Error CS1502: The best overloaded method match for `Stetic.Gui.Initialize(Gtk.Widget)' has some invalid arguments (CS1502) (iwawi)
/home/jacek/Documents/Projects/iwawi/iwawi/gtk-gui/iwawi.tools.AboutDialog.cs(35,35): Error CS1503: Argument `#1' cannot convert `iwawi.tools.AboutDialog' expression to type `Gtk.Widget' (CS1503) (iwawi)
/home/jacek/Documents/Projects/iwawi/iwawi/gtk-gui/iwawi.tools.AboutDialog.cs(9,9): Error CS1061: Type `iwawi.tools.AboutDialog' does not contain a definition for `Name' and no extension method `Name' of type `iwawi.tools.AboutDialog' could be found. Are you missing an assembly reference? (CS1061) (iwawi)
/home/jacek/Documents/Projects/iwawi/iwawi/gtk-gui/iwawi.tools.AboutDialog.cs(42,42): Error CS1502: The best overloaded method match for `Stetic.IconLoader.LoadIcon(Gtk.Widget, string, Gtk.IconSize)' has some invalid arguments (CS1502) (iwawi)
/home/jacek/Documents/Projects/iwawi/iwawi/gtk-gui/iwawi.tools.AboutDialog.cs(52,52): Error CS1503: Argument `#1' cannot convert `iwawi.tools.AboutDialog' expression to type `Gtk.Widget' (CS1503) (iwawi)

The GUI designer recognizes my object as a Gtk.Dialog, so I don't really
understand why Gtk-Widget appears in some of the error messages.

Here is the autogenerated code:


// This file has been generated by the GUI designer. Do not modify.
namespace iwawi
{
	public partial class AboutDialog
	{
		private global::Gtk.Fixed @fixed;
		
		private global::Gtk.Image appIcon;
		
		private global::Gtk.Label aboutTextLabel;
		
		private global::Gtk.Button closeButton;
		
		private global::Gtk.Button button694;

		protected virtual void Build ()
		{
			global::Stetic.Gui.Initialize (this);
			// Widget iwawi.AboutDialog
			this.Events = ((global::Gdk.EventMask)(256));
			this.Name = "iwawi.AboutDialog";
			this.Title = "";
			this.TypeHint = ((global::Gdk.WindowTypeHint)(1));
			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
			this.Modal = true;
			this.Resizable = false;
			this.AllowShrink = true;
			this.DefaultWidth = 600;
			this.DefaultHeight = 277;
			this.DestroyWithParent = true;
			// Internal child iwawi.AboutDialog.VBox
			global::Gtk.VBox w1 = this.VBox;
			w1.Events = ((global::Gdk.EventMask)(256));
			w1.Name = "dialog_VBox";
			w1.BorderWidth = ((uint)(2));
			// Container child dialog_VBox.Gtk.Box+BoxChild
			this. at fixed = new global::Gtk.Fixed ();
			this. at fixed.Name = "fixed";
			this. at fixed.HasWindow = false;
			// Container child fixed.Gtk.Fixed+FixedChild
			this.appIcon = new global::Gtk.Image ();
			this.appIcon.Name = "appIcon";
			this.appIcon.Pixbuf = new global::Gdk.Pixbuf
(global::System.IO.Path.Combine
(global::System.AppDomain.CurrentDomain.BaseDirectory,
"./iwawi_splashscreen.png"));
			this. at fixed.Add (this.appIcon);
			// Container child fixed.Gtk.Fixed+FixedChild
			this.aboutTextLabel = new global::Gtk.Label ();
			this.aboutTextLabel.WidthRequest = 250;
			this.aboutTextLabel.HeightRequest = 100;
			this.aboutTextLabel.Name = "aboutTextLabel";
			this.aboutTextLabel.Xpad = 5;
			this.aboutTextLabel.Ypad = 5;
			this.aboutTextLabel.UseMarkup = true;
			this. at fixed.Add (this.aboutTextLabel);
			global::Gtk.Fixed.FixedChild w3 =
((global::Gtk.Fixed.FixedChild)(this. at fixed [this.aboutTextLabel]));
			w3.X = 197;
			w3.Y = 8;
			// Container child fixed.Gtk.Fixed+FixedChild
			this.closeButton = new global::Gtk.Button ();
			this.closeButton.WidthRequest = 120;
			this.closeButton.HeightRequest = 40;
			this.closeButton.CanDefault = true;
			this.closeButton.CanFocus = true;
			this.closeButton.Name = "closeButton";
			this.closeButton.UseUnderline = true;
			this.closeButton.Label = global::Mono.Unix.Catalog.GetString
("Schließen");
			global::Gtk.Image w4 = new global::Gtk.Image ();
			w4.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-close",
global::Gtk.IconSize.Menu);
			this.closeButton.Image = w4;
			this. at fixed.Add (this.closeButton);
			global::Gtk.Fixed.FixedChild w5 =
((global::Gtk.Fixed.FixedChild)(this. at fixed [this.closeButton]));
			w5.X = 340;
			w5.Y = 210;
			w1.Add (this. at fixed);
			global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1
[this. at fixed]));
			w6.Position = 0;
			w6.Expand = false;
			w6.Fill = false;
			// Internal child iwawi.AboutDialog.ActionArea
			global::Gtk.HButtonBox w7 = this.ActionArea;
			w7.Name = "__gtksharp_96_Stetic_TopLevelDialog_ActionArea";
			// Container child
__gtksharp_96_Stetic_TopLevelDialog_ActionArea.Gtk.ButtonBox
+ButtonBoxChild
			this.button694 = new global::Gtk.Button ();
			this.button694.CanFocus = true;
			this.button694.Name = "button694";
			this.button694.UseUnderline = true;
			this.button694.Label = global::Mono.Unix.Catalog.GetString
("GtkButton");
			this.AddActionWidget (this.button694, 0);
			global::Gtk.ButtonBox.ButtonBoxChild w8 =
((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.button694]));
			w8.Expand = false;
			w8.Fill = false;
			if ((this.Child != null)) {
				this.Child.ShowAll ();
			}
			this.Show ();
			this.closeButton.Clicked += new global::System.EventHandler
(this.onCloseButtonClicked);
		}
	}
}

Any useful hints are welcome.

Thanks & regards
Jacek Rużyczka




More information about the Monodevelop-list mailing list