# \[Python\] Button in Custom Instrument

**URL:** <https://forum.opentap.io/t/python-button-in-custom-instrument/2073>\
**Category:** Technical\
**Tags:** gui\
**Created:** [July 29, 2024, 12:52pm UTC](https://forum.opentap.io/t/python-button-in-custom-instrument/2073 "2024-07-29T12:52:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cliff](https://avatars.discourse-cdn.com/v4/letter/c/b38774/32.png) [@cliff](https://forum.opentap.io/u/cliff)\
**Post date:** [July 29, 2024, 12:52pm UTC](https://forum.opentap.io/t/python-button-in-custom-instrument/2073/1 "2024-07-29T12:52:16Z")

</div>

Hi,

Is it possible to add buttons to instrument settings panel?  
I tried to add the button using:

```csharp
@attribute(Display("Reset Coordinates to [0,0,0]", "Coordinates", "AR Coordinates"))
@attribute(Browsable(True))
def ResetCoordinates(self):
    self.log.Info("Reseeting Coordinates")

```

The above code snippet doesn’t work.

Regards.

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [July 30, 2024, 1:05pm UTC](https://forum.opentap.io/t/python-button-in-custom-instrument/2073/2 "2024-07-30T13:05:00Z")

</div>

In the BasicFunctionality example this is described:

```py
    #This Reset Frequency method is exposed to the user as a button that can be clicked.
    @attribute(Browsable(True))
    @attribute(OpenTap.EnabledIf("FrequencyIsDefault", False, HideIfDisabled = True))
    @attribute(OpenTap.Display("Reset Frequency", None))
    @method()
    def resetFrequency(self):
        self.Frequency = 1e9

```

You just need to declare that your method should be a CLR method.
