generative modeling for Rhino
Hi (David)
I would like to add a panel button to my custom GH toolbar.
I which .dll does the panel code reside? I would like to help myself by copying bits from your code David.
cheers!
Tags:

Hi Jes,
toolbar? Rhino toolbar or Grasshopper toolbar?
Components are automatically added to the Grasshopper toolbar when they are loaded. All you have to do is supply a Category (the name of the tab), a subcategory (the name of the panel), the Exposure (the group within the panel, as separated by etches) and an icon (24 x 24 pixels).
--
David Rutten
david@mcneel.com
Turku, Finland
Permalink Reply by Jes Tonsgaard on April 28, 2011 at 12:28am Right.. Grasshopper custom coponent Category and Subcategory it is.
I use reflector to learn from your coding of different components, but have not managed to find the Params->Special subcategory in the .gha files.
So basically, I would like a hint as to where in the grasshopper installation files do I find that?
- More specific, I would like to see the code of the "panel" component.
cheers
Permalink Reply by Danny Boyes on April 28, 2011 at 1:00am 
It is indeed. Don't tell me you didn't read the license agreement?! :)
Tabs and Panels are created whenever they are needed. So if you create a Component tht defines Category=Humbug, SubCategory=Poppycock, then the Humbug Tab and the Poppycock panel will be automatically added to cater for your icon.
--
David Rutten
david@mcneel.com
Turku, Finland
Permalink Reply by Jes Tonsgaard on April 28, 2011 at 3:28am I allways read the license agreement... :-)
All I wanted was to see how the panel component was scripted (the little yellow box that you can enter text in when placed on the canvas, -see the image) - If that is outside any sort of licensing, copyright bounds, I apologize.

Ah, the Text Panel object! I thought you were talking about the Ribbon panels (the little frames with black bars at the bottom).
Panel is quite a complex piece of work. It certainly doesn't serve well as a case study regarding custom objects. You might want to look at the Boolean Toggle or Colour Swatch components, those are fairly easy.
Most of these special objects are defined in the Grasshopper.Kernel.Special interface if you feel you must look at the code. As long as you realise it is a violation of the license agreement to decompile/disassemble any part of Grasshopper.
Note that all of the clever mouse interaction and display stuff happens inside the attributes of an object, not the object itself. So you'll find both a GH_ColourSwatch and a GH_ColourSwatchAttributes class and they work together.
--
David Rutten
david@mcneel.com
Turku, Finland

Just in case I missed the point entirely yet again, if you want to add the existing panel object to your toolbar... you can't. Objects can only appear once in the Grasshopper tabs. But you can make a UserObject out of a panel and put that one in your toolbar.
--
David Rutten
david@mcneel.com
Turku, Finland
Permalink Reply by Jes Tonsgaard on April 28, 2011 at 3:58am
That path is what I was looking for. Thanks.
And I just saw that my first post gives a rather undesired impression. It should have said something along the lines of:
"I would like to help myself by LOOKING and LEARNING from your code David." (mods, feel free to change or delete the original text)
cheers
Permalink Reply by Jes Tonsgaard on April 28, 2011 at 7:47am
© 2012 Created by Scott Davidson.
Powered by