<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Vanilla set.text to TextBox]]></title><description><![CDATA[<p dir="auto">I know this is a vanilla question but probably it will be easy to answer by someone.<br />
I want to set the text to a <code>TextBox</code> (for a progressbar, to follow what's going on) but I can't get it updated. Any help?</p>
<pre><code class="language-python">from vanilla import *
from time import sleep

class Test():

    def __init__ (self):
        self.w = Window((200, 100), 'a W')
        self.w.text = TextBox((10, 10, -10, -10), 'start')
        self.w.open()
        
        # set text
        self.counter = 0
        while self.counter &lt; 10:
            print self.counter
            self.w.text.set(self.counter)
            sleep(1)
            self.counter += 2
        else:
            print 'finished counting'
            
Test()
</code></pre>
]]></description><link>https://forum.robofont.com/topic/244/vanilla-set-text-to-textbox</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 23:25:26 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/244.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Mar 2013 11:52:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Vanilla set.text to TextBox on Tue, 02 Jan 2018 20:06:46 GMT]]></title><description><![CDATA[<p dir="auto">I know this is a vanilla question but probably it will be easy to answer by someone.<br />
I want to set the text to a <code>TextBox</code> (for a progressbar, to follow what's going on) but I can't get it updated. Any help?</p>
<pre><code class="language-python">from vanilla import *
from time import sleep

class Test():

    def __init__ (self):
        self.w = Window((200, 100), 'a W')
        self.w.text = TextBox((10, 10, -10, -10), 'start')
        self.w.open()
        
        # set text
        self.counter = 0
        while self.counter &lt; 10:
            print self.counter
            self.w.text.set(self.counter)
            sleep(1)
            self.counter += 2
        else:
            print 'finished counting'
            
Test()
</code></pre>
]]></description><link>https://forum.robofont.com/post/244</link><guid isPermaLink="true">https://forum.robofont.com/post/244</guid><dc:creator><![CDATA[joanca]]></dc:creator><pubDate>Tue, 02 Jan 2018 20:06:46 GMT</pubDate></item><item><title><![CDATA[Reply to Vanilla set.text to TextBox on Tue, 02 Jan 2018 20:07:46 GMT]]></title><description><![CDATA[<p dir="auto">can you use the defconAppKit <code>progressWindow</code>?</p>
<p dir="auto">see <a href="http://code.typesupply.com/browser/packages/defconAppKit/trunk/Lib/defconAppKit/windows/progressWindow.py" rel="nofollow">http://code.typesupply.com/browser/packages/defconAppKit/trunk/Lib/defconAppKit/windows/progressWindow.py</a></p>
<p dir="auto">Cocoa is build up rather smart so it checks when a view is been updated frequently before redrawing it on screen.</p>
<p dir="auto">Although you can force a redraw:</p>
<pre><code class="language-python">self.w.text.getNSTextField().display()
</code></pre>
<p dir="auto">after setting a string into the <code>TextBox</code></p>
]]></description><link>https://forum.robofont.com/post/1007</link><guid isPermaLink="true">https://forum.robofont.com/post/1007</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Tue, 02 Jan 2018 20:07:46 GMT</pubDate></item></channel></rss>