# Tab menu options on component through GhPython

**URL:** <https://discourse.mcneel.com/t/tab-menu-options-on-component-through-ghpython/79220>\
**Category:** Grasshopper\
**Created:** [February 23, 2019, 5:04pm UTC](https://discourse.mcneel.com/t/tab-menu-options-on-component-through-ghpython/79220 "2019-02-23T17:04:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![amirrgoli](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/amirrgoli/32/138704_2.png) [@amirrgoli](https://discourse.mcneel.com/u/amirrgoli)\
**Post date:** [February 23, 2019, 5:04pm UTC](https://discourse.mcneel.com/t/tab-menu-options-on-component-through-ghpython/79220/1 "2019-02-23T17:04:02Z")

</div>

hi…Like this component, it has select different option…  
Is it possible to achieve that through GHpython after compiling into ghpy file?

 ![2019-02-23%2009_02_47-Grasshopper%20-%20read-write_](https://global.discourse-cdn.com/mcneel/original/3X/d/5/d5bf072ec8278aa66f68ca39eb30fbd9d3ee0699.png)  
tnx

---

<div class="post-metadata">

**Author:** ![chanley](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/chanley/32/341693_2.png) [@chanley](https://discourse.mcneel.com/u/chanley)\
**Post date:** [February 23, 2019, 7:18pm UTC](https://discourse.mcneel.com/t/tab-menu-options-on-component-through-ghpython/79220/2 "2019-02-23T19:18:48Z")

</div>

There is some discussion on context menus in a GHPython component here:

> [@Button and context menu options on component through GhPython](https://discourse.mcneel.com/t/button-and-context-menu-options-on-component-through-ghpython/54638):
>
> Hi! Like this component, it has an Update button, and 3 option list if you Right-Click this. Is it possible to achieve that through GHpython after compiling into ghpy file? [3]

There is also some discussion on when to consider switching over to Visual studio to implement more sophisticated component options.

---

<div class="post-metadata">

**Author:** ![amirrgoli](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/amirrgoli/32/138704_2.png) [@amirrgoli](https://discourse.mcneel.com/u/amirrgoli)\
**Post date:** [February 23, 2019, 8:01pm UTC](https://discourse.mcneel.com/t/tab-menu-options-on-component-through-ghpython/79220/3 "2019-02-23T20:01:35Z")

</div>

I know… But… I can’t found code for it…

---

<div class="post-metadata">

**Author:** ![tim.stark](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tim.stark/32/704108_2.png) [@tim.stark](https://discourse.mcneel.com/u/tim.stark)\
**Post date:** [February 23, 2019, 8:07pm UTC](https://discourse.mcneel.com/t/tab-menu-options-on-component-through-ghpython/79220/4 "2019-02-23T20:07:31Z")

</div>

Look the link posted above by @chanley .  
The first answer of Guilio Piacentio already includes a gh file to download…

---

<div class="post-metadata">

**Author:** ![amirrgoli](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/amirrgoli/32/138704_2.png) [@amirrgoli](https://discourse.mcneel.com/u/amirrgoli)\
**Post date:** [February 23, 2019, 8:26pm UTC](https://discourse.mcneel.com/t/tab-menu-options-on-component-through-ghpython/79220/5 "2019-02-23T20:26:53Z")

</div>

Tnx… But… This file didn’t work for my problem…

---

<div class="post-metadata">

**Author:** ![tim.stark](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tim.stark/32/704108_2.png) [@tim.stark](https://discourse.mcneel.com/u/tim.stark)\
**Post date:** [February 23, 2019, 8:30pm UTC](https://discourse.mcneel.com/t/tab-menu-options-on-component-through-ghpython/79220/6 "2019-02-23T20:30:08Z")

</div>

Ok, then maybe tell us what your problem is? What’s not working? Hard to help without information.

---

<div class="post-metadata">

**Author:** ![chanley](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/chanley/32/341693_2.png) [@chanley](https://discourse.mcneel.com/u/chanley)\
**Post date:** [February 23, 2019, 8:31pm UTC](https://discourse.mcneel.com/t/tab-menu-options-on-component-through-ghpython/79220/7 "2019-02-23T20:31:58Z")

</div>

From a development side, it seems that…while it may be possible to implement some more sophisticated custom ghpython component features, it may not be the most effective mechanism. If you need to add additional customization to your component, you may want to consider developing in visual studio/c#.  
For a “simple” ghpython context menu, here is one example:

> [@Handle/update the checked state of a menu item](https://discourse.mcneel.com/t/handle-update-the-checked-state-of-a-menu-item/66971/3):
>
> Thanks! I was missing the step of storing an attribute for each independent variable and doing something in the event handler to change the menu items from checked to unchecked. Your samples allowed me to get my first custom context menu working! It’s good enough for what I was hoping to accomplish. Thank you again for all of your help! Below is the code that worked for me. Note: Rhino 6, (6.7.18190.21071, 07/09/2018). GH python component in SDK mode. from ghpyt…

---

<div class="post-metadata">

**Author:** ![amirrgoli](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/amirrgoli/32/138704_2.png) [@amirrgoli](https://discourse.mcneel.com/u/amirrgoli)\
**Post date:** [February 24, 2019, 5:51am UTC](https://discourse.mcneel.com/t/tab-menu-options-on-component-through-ghpython/79220/8 "2019-02-24T05:51:14Z")

</div>

> [@chanley](#):
>
> developing in visual studio/c#.

tnx a lot …can you help me for developing in visual studio/c#.? one sample?

---

<div class="post-metadata">

**Author:** ![amirrgoli](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/amirrgoli/32/138704_2.png) [@amirrgoli](https://discourse.mcneel.com/u/amirrgoli)\
**Post date:** [February 24, 2019, 5:53am UTC](https://discourse.mcneel.com/t/tab-menu-options-on-component-through-ghpython/79220/9 "2019-02-24T05:53:39Z")

</div>

> [@chanley](#):
>
> a development side

a development side…open tab and choice option…
