# I cannot understand how eto work

**URL:** <https://discourse.mcneel.com/t/i-cannot-understand-how-eto-work/76504>\
**Category:** Rhino Developer\
**Created:** [December 19, 2018, 11:25am UTC](https://discourse.mcneel.com/t/i-cannot-understand-how-eto-work/76504 "2018-12-19T11:25:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![s.branca](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/s.branca/32/249107_2.png) [@s.branca](https://discourse.mcneel.com/u/s.branca)\
**Post date:** [December 19, 2018, 11:25am UTC](https://discourse.mcneel.com/t/i-cannot-understand-how-eto-work/76504/1 "2018-12-19T11:25:23Z")

</div>

```auto
import rhinoscriptsyntax as rs
import Rhino.UI
import Eto.Drawing as drawing
import Eto.Forms as forms
__commandname__ = "FindHole"

class SimpleEtoDialog(forms.Dialog):

    def __init__ (self):
        self.Title = "Sample Eto Dialog"
        self.ClientSize = drawing.Size(200, 200)
        self.Padding = drawing.Padding(5)
        self.Resizable = False
        layout = forms.DynamicLayout()
        layout.Padding = drawing.Padding(5)
        layout.Spacing = drawing.Size(5, 5)
        layout.AddRow(forms.Label(Text ="i !"))
        layout.AddRow(forms.Label(Text ="am"))
        layout.AddRow(forms.Label(Text ="NOT"))
        layout.AddRow(forms.Label(Text ="WORKING!"))

################################################################################
# Creating a dialog instance and displaying the dialog.
################################################################################
def TestSampleEtoDialog():
    dialog = SimpleEtoDialog()
    dialog.ShowModal(Rhino.UI.RhinoEtoApp.MainWindow)
    
################################################################################
# Check to see if this file is being executed as the "main" python
# script instead of being used as a module by some other python script
# This allows us to use the module which ever way we want.
################################################################################
if __name__ == " __main__":
    TestSampleEtoDialog() 

```

i simply try to edit a ETO sample but other than changing the string i cannot understand the correlation from Layout and effect

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [December 20, 2018, 9:39pm UTC](https://discourse.mcneel.com/t/i-cannot-understand-how-eto-work/76504/2 "2018-12-20T21:39:56Z")

</div>

Hi @s.branca,

Layouts are used to organize controls on your form. Eto includes a couple of different types of layout classes.

[https://github.com/picoe/Eto/wiki/Containers](https://github.com/picoe/Eto/wiki/Containers)

Here is some info on `DynamicLayout`.

[https://github.com/picoe/Eto/wiki/DynamicLayout](https://github.com/picoe/Eto/wiki/DynamicLayout)

– Dale

---

<div class="post-metadata">

**Author:** ![s.branca](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/s.branca/32/249107_2.png) [@s.branca](https://discourse.mcneel.com/u/s.branca)\
**Post date:** [December 21, 2018, 7:34am UTC](https://discourse.mcneel.com/t/i-cannot-understand-how-eto-work/76504/3 "2018-12-21T07:34:19Z")

</div>

thanks, is there any phyton script too?  
\_Stefano

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [December 21, 2018, 7:39am UTC](https://discourse.mcneel.com/t/i-cannot-understand-how-eto-work/76504/4 "2018-12-21T07:39:30Z")

</div>

You are missing a `self.Content = layout`.

Just creating a layout is not enough, you need to put it somewhere so it actually can show up.

---

<div class="post-metadata">

**Author:** ![s.branca](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/s.branca/32/249107_2.png) [@s.branca](https://discourse.mcneel.com/u/s.branca)\
**Post date:** [December 23, 2018, 9:47am UTC](https://discourse.mcneel.com/t/i-cannot-understand-how-eto-work/76504/5 "2018-12-23T09:47:29Z")

</div>

import rhinoscriptsyntax as rs  
import Rhino.UI  
import Eto.Drawing as drawing  
import Eto.Forms as forms  
**commandname** = “FindHole”

class SimpleEtoDialog(forms.Dialog):

```
def __init__ (self):
    self.Title = "Sample Eto Dialog"
    self.ClientSize = drawing.Size(200, 200)
    self.Padding = drawing.Padding(5)
    self.Resizable = False
    layout = forms.DynamicLayout()
    self.content = layout
    
    ##it is not working either.... 4
    
    
    layout.Padding = drawing.Padding(5)
    layout.Spacing = drawing.Size(5, 5)
    layout.AddRow(forms.Label(Text ="i !"))
    layout.AddRow(forms.Label(Text ="am"))
    layout.AddRow(forms.Label(Text ="NOT"))
    layout.AddRow(forms.Label(Text ="WORKING!"))

```

################################################################################

# Creating a dialog instance and displaying the dialog.

################################################################################  
def TestSampleEtoDialog():  
dialog = SimpleEtoDialog()  
dialog.ShowModal(Rhino.UI.RhinoEtoApp.MainWindow)

################################################################################

# Check to see if this file is being executed as the “main” python

# script instead of being used as a module by some other python script

# This allows us to use the module which ever way we want.

################################################################################  
if **name** == “ **main** ”:  
TestSampleEtoDialog()

---

<div class="post-metadata">

**Author:** ![jesterking](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jesterking/32/771114_2.png) [@jesterking](https://discourse.mcneel.com/u/jesterking)\
**Post date:** [December 23, 2018, 9:59am UTC](https://discourse.mcneel.com/t/i-cannot-understand-how-eto-work/76504/6 "2018-12-23T09:59:23Z")

</div>

You typoed Content…

---

<div class="post-metadata">

**Author:** ![s.branca](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/s.branca/32/249107_2.png) [@s.branca](https://discourse.mcneel.com/u/s.branca)\
**Post date:** [December 23, 2018, 11:13am UTC](https://discourse.mcneel.com/t/i-cannot-understand-how-eto-work/76504/7 "2018-12-23T11:13:58Z")

</div>

it works! thanks…

---

<div class="post-metadata">

**Author:** ![jesterking](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jesterking/32/771114_2.png) [@jesterking](https://discourse.mcneel.com/u/jesterking)\
**Post date:** [December 23, 2018, 11:16am UTC](https://discourse.mcneel.com/t/i-cannot-understand-how-eto-work/76504/8 "2018-12-23T11:16:16Z")

</div>

Have fun with Eto.Forms (:

---

<div class="post-metadata">

**Author:** ![s.branca](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/s.branca/32/249107_2.png) [@s.branca](https://discourse.mcneel.com/u/s.branca)\
**Post date:** [December 23, 2018, 11:23am UTC](https://discourse.mcneel.com/t/i-cannot-understand-how-eto-work/76504/9 "2018-12-23T11:23:10Z")

</div>

do you know more eto’s example beyond this one? [https://developer.rhino3d.com/guides/rhinopython/eto-controls-python/#sample-dialogs](https://developer.rhino3d.com/guides/rhinopython/eto-controls-python/#sample-dialogs)

---

<div class="post-metadata">

**Author:** ![jesterking](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jesterking/32/771114_2.png) [@jesterking](https://discourse.mcneel.com/u/jesterking)\
**Post date:** [December 23, 2018, 11:35am UTC](https://discourse.mcneel.com/t/i-cannot-understand-how-eto-work/76504/10 "2018-12-23T11:35:59Z")

</div>

I have really used Eto only with F# and C#, but it should be pretty straightforward to learn from examples in those languages, then transform to information into Python versions.
