[MonoDevelop] Stetic GUI Designer Manual

TheWind777 TheWind777 at hotmail.com
Fri Jul 3 20:59:34 UTC 2015

I am now going deeper into the code that it creates.

I'm confused... because by the code, you'd think it would work?

What the Designer is doing:

When a button is defined in the Designer GUI, the Designer creates a file in
that Project's gtk-gui folder called MainWindow.cs

In it is the Build() function, and it defines all of the buttons.

If you had set the name of the button to equal Button3, and you defined a
Stock Icon named key3 by using a Resource of key3.ico that was set to have a
Build Action = EmbeddedResources then the code that is made in this  file
looks like this:

                // Container child hbox7.Gtk.Box+BoxChild
		this.Button3 = new global::Gtk.Button ();
		this.Button3.CanFocus = true;
		this.Button3.Name = "Button3";
		this.Button3.UseStock = true;
		this.Button3.UseUnderline = true;
		this.Button3.Label = "key3";
		this.hbox7.Add (this.Button3);

Notice, that it sets the Label to the name of the Stock Icon and then sets a
UseStock flag on the Stetic.Button to true.

This is very similar to the way that Gtk# does buttons.

It is using the name of the Button's Label as the Icon to load into the
Button if UseStock flag is true (which it is in the code) (Gtk# uses a
Button.use-stock flag, which is defunct now... but the Designer isn't caring
about that, or using it).

Here is the definition of that action:


... and the part of the code which actually should be properly setting the
StockID equal to the Label string is:

if (button.UseStock) { 
               				type = ButtonType.StockItem; 
               				StockId = button.Label;

So I don't understand why it's not working. Somehow, instead of interpreting
the label name as the StockItem name, it's letting it pass-through and it is
acting as a regular label, instead.

Why?  Anybody see why it wouldn't be showing the StockItem; but instead, is
showing the label as a label instead of it doing the StockItem image?

When I go to 'Help->About' on the Stetic GUI Designer, it says it is version
5.9.4... which is the latest version of MonoDevelop.

Help...  I see no reason why it isn't showing the icon... but instead is
ignoring the label as being a StockItem name and is showing it as a regular

Someone who knows more see this...

View this message in context: http://mono.1490590.n4.nabble.com/Stetic-GUI-Designer-Manual-tp4666277p4666286.html
Sent from the Mono - MonoDevelop IDE mailing list archive at Nabble.com.

More information about the Monodevelop-list mailing list