[MonoDevelop] make my own widget

IBBoard ibboard at gmail.com
Fri Oct 5 18:45:04 UTC 2012


Which part are you struggling with?

If you want to create a custom widget then you can right-click on a 
project or folder, then click Add > New Widget. It'll then prompt you 
for a name. Once you enter a name, it'll open the file (in source code 
view by default). Click on the "Designer" button at the bottom of the 
window and you'll see the designer view, which can be edited in the same 
way as any other form to create a composite widget.

To get your widget to show up in the MonoDevelop toolbox then you need 
to add:

         [System.ComponentModel.ToolboxItem(true)]

before the class definition, compile the code, and then click the "+" 
button at the top of the toolbox and click "Add Assembly". Once you've 
added your assembly then you can select the controls to see.

If you want something a bit more advanced/customised (which won't 
necessarily fit in with GTK as well) then follow the same instructions 
but pick "Custom Drawn Widget" instead and you'll get a 
Gtk.DrawableArea, which gives you full control over the widget drawing.

Other than that then it depends on what you want the widget to do. Most 
of my custom widgets are combinations of other widgets in a fixed layout 
with appropriate hooks in place to keep values in sync between them. 
There's nothing special in the rendering, but the custom widget keeps 
consistency when a control is re-used.

Hope that helps a bit.


On 05/10/12 01:08, blueeagle2 at gmail.com wrote:
> I was wondering if there are any tutorials on how to make custom widgets
> for theStetic GUI Designer.  The tutorials I have been able to find are
> not very good.  Even the video on the MonoDevelop web site was not
> particularly great since the guy doing the video could not speak English
> very well so it was hard to understand half of what he was saying.
>
> What I really need is a timedate widget similar to what you would find
> in Visual C# express.  Or if anyone knows how to create one or has such
> a library that would be great.  I had high hopes for Monodevelop since
> it is a C# IDE, but if it is only good for console applications, it is
> not much good to me.
>
>
>
>
> _______________________________________________
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-list
>


More information about the Monodevelop-list mailing list