# Updating text in Eto Progress Bar

**URL:** <https://discourse.mcneel.com/t/updating-text-in-eto-progress-bar/160705>\
**Category:** Rhino Developer\
**Tags:** windows, ghpython, eto, gh\
**Created:** [May 30, 2023, 11:15am UTC](https://discourse.mcneel.com/t/updating-text-in-eto-progress-bar/160705 "2023-05-30T11:15:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Belen](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/belen/32/762251_2.png) [@Belen](https://discourse.mcneel.com/u/Belen)\
**Post date:** [May 30, 2023, 11:15am UTC](https://discourse.mcneel.com/t/updating-text-in-eto-progress-bar/160705/1 "2023-05-30T11:15:45Z")

</div>

Hello, is it possible to dynamically update the text of an Eto progress bar?

Here my code:

```python
import System
import Rhino
import Rhino.UI
import Eto.Drawing as drawing
import Eto.Forms as forms
import scriptcontext as sc

class SampleEtoModelessForm(forms.Form):
    
    # Initializer
    def __init__ (self):
        self.m_selecting = False
        
        self.Title = title
        self.Padding = drawing.Padding(5)
        self.Resizable = True
        self.Maximizable = False
        self.Minimizable = False
        self.ShowInTaskbar = False
        self.Topmost = True
        self.MinimumSize = drawing.Size(500, 100)
        # FormClosed event handler
        self.Closed += self.OnFormClosed

        # Create Progress Bar
        self.m_progressbar = forms.ProgressBar()
        self.m_progressbar.MinValue = min
        self.m_progressbar.MaxValue = max
        self.m_textbox = forms.TextBox(Text = None)

        layout = forms.DynamicLayout()
        layout.Padding = drawing.Padding(10)
        layout.Spacing = drawing.Size(5, 5)
        layout.Rows.Add(forms.Label(Text = text))
        layout.AddRow(None) # spacer
    
        layout.AddRow(self.m_progressbar)
        self.Content = layout

    def updateProgressBar(self, value):
        
        self.m_progress = val
        if self.m_progress > max:
            self.m_progress = max
        self.m_progressbar.Value = self.m_progress

    def OnFormClosed(self, sender, e):

        if sc.sticky.has_key(title):
            form = sc.sticky[title]
            if form:
                form.Dispose()
                form = None
            sc.sticky.Remove(title)

if run:
    if sc.sticky.has_key(title):
        pass
    else:
        form = SampleEtoModelessForm()
        form.Owner = Rhino.UI.RhinoEtoApp.MainWindow
        form.Show()
        sc.sticky[title] = form
        
    form.updateProgressBar(val)

if reset:
    sc.sticky.clear()

if close:
    form.Dispose()

```

![Screenshot_1](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/d/a/9da18316fd42ac309fa8fa84a8678f76b015fe3c.jpeg)

Can anyone help me with this? Maybe @curtisw ?

---

<div class="post-metadata">

**Author:** ![curtisw](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/curtisw/32/769477_2.png) [@curtisw](https://discourse.mcneel.com/u/curtisw)\
**Post date:** [May 31, 2023, 3:37pm UTC](https://discourse.mcneel.com/t/updating-text-in-eto-progress-bar/160705/2 "2023-05-31T15:37:32Z")

</div>

@Belen all you need to do is capture the label when you create it, something like:

`myLabel = forms.Label(Text = text)`

Then to update the text:

`myLabel.Text = "Some New Text"`

---

<div class="post-metadata">

**Author:** ![Belen](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/belen/32/762251_2.png) [@Belen](https://discourse.mcneel.com/u/Belen)\
**Post date:** [June 7, 2023, 12:52pm UTC](https://discourse.mcneel.com/t/updating-text-in-eto-progress-bar/160705/3 "2023-06-07T12:52:39Z")

</div>

thank you @curtisw!
