<?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[[UiFlow] The ability to display multiple &quot;screens&quot; or &quot;cards&quot;]]></title><description><![CDATA[<p dir="auto">I've not found this function after a lot of use, so I'm making the assumption that it's not present.</p>
<p dir="auto">What I'd like to suggest, is the ability to define separate "Screens" in a single integrated UiFlow Program.</p>
<p dir="auto">This would operate somewhat like an old "HyperCard" stack, where each "screen" has a separate and defined UI that can be set up via the UiFlow editor.<br />
(Navigation between screens during coding could be added just above the "Units" Selector)</p>
<p dir="auto">To keep code clean, there could be a "screen 0" that contains code that is present across the whole project (e.g.  Wifi Connections, MQTT, Global Variables) and sets instructions for an initial screen display or which screen to switch to.<br />
Screens are traversed via blocks that instruct which screen to switch to, which could be tied to events or button presses.<br />
Events/Functions can be triggered by switching into screens (Much like Setup is used per project) or switching away.</p>
<p dir="auto">This simple change could clean up messy projects that rely on code to move the screen around, enhance projects that are data driven, make UI design simpler and more intuitive and add a world of function and the opportunity for more complexity into this simple software.</p>
]]></description><link>https://community.m5stack.com/topic/3336/uiflow-the-ability-to-display-multiple-screens-or-cards</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 15:46:06 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3336.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 30 May 2021 11:54:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [UiFlow] The ability to display multiple &quot;screens&quot; or &quot;cards&quot; on Thu, 12 Aug 2021 17:59:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pumpkinetcher" aria-label="Profile: pumpkinetcher">@<bdi>pumpkinetcher</bdi></a></p>
<p dir="auto">see <a href="https://github.com/hjgode/m5home" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/hjgode/m5home</a> <a href="http://main.py" target="_blank" rel="noopener noreferrer nofollow ugc">main.py</a></p>
]]></description><link>https://community.m5stack.com/post/14624</link><guid isPermaLink="true">https://community.m5stack.com/post/14624</guid><dc:creator><![CDATA[Josef]]></dc:creator><pubDate>Thu, 12 Aug 2021 17:59:22 GMT</pubDate></item><item><title><![CDATA[Reply to [UiFlow] The ability to display multiple &quot;screens&quot; or &quot;cards&quot; on Thu, 12 Aug 2021 17:55:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pumpkinetcher" aria-label="Profile: pumpkinetcher">@<bdi>pumpkinetcher</bdi></a></p>
<p dir="auto">You can have multiple screens, for example in an array, and then switch the screens with screen.load_screen(screens[i])</p>
<p dir="auto">I use it like this</p>
<p dir="auto">screen = M5Screen()<br />
screen.clean_screen()<br />
screen.set_screen_bg_color(0xadefeb)<br />
screen.set_screen_brightness(60)<br />
#an array to store screens<br />
screens=[]</p>
<p dir="auto">now everything (M5Label etc) will be drawn on the current screen.<br />
I end the screen with<br />
screen0 = screen.get_act_screen()<br />
screens.append(screen0)</p>
<p dir="auto">then start a new screen with</p>
<h1>get a new screen</h1>
<p dir="auto">screen1 = screen.get_new_screen()<br />
screen.load_screen(screen1)<br />
then end this screen and so on<br />
screen1 = screen.get_act_screen()<br />
screens.append(screen1)</p>
<p dir="auto">To switch the screen I use<br />
def getPrevScreen():<br />
global current_screen, screens<br />
lock_obj.acquire()<br />
print('getPrevScreen called')<br />
current_screen-=1<br />
if current_screen &lt; 0 :<br />
current_screen=0<br />
else:<br />
screen.load_screen(screens[current_screen])<br />
lock_obj.release()<br />
pass<br />
def getNextScreen():<br />
global current_screen, screens<br />
lock_obj.acquire()<br />
print('getNextScreen called')<br />
current_screen+=1<br />
if current_screen &gt; len(screens)-1 :<br />
current_screen=len(screens)-1<br />
else:<br />
screen.load_screen(screens[current_screen])<br />
lock_obj.release()<br />
pass<br />
these are called by<br />
def buttonA_wasPressed():</p>
<h1>global params</h1>
<p dir="auto">do_beep()<br />
reset_idle_counter()<br />
print('ButtonA pressed')</p>
<h1>screen.clean_screen()</h1>
<h1>screen.load_screen(screen0)</h1>
<h1>screen.load_screen(screens[0])</h1>
<h1>getPrevScreen()</h1>
<p dir="auto">_thread.start_new_thread(getPrevScreen, ())<br />
pass<br />
btnA.wasPressed(buttonA_wasPressed)<br />
and<br />
def buttonC_wasPressed():<br />
do_beep()<br />
reset_idle_counter()<br />
print('ButtonC pressed')</p>
<h1>screen.clean_screen()</h1>
<h1>screen.load_screen(screen2)</h1>
<h1>getNextScreen()</h1>
<p dir="auto">_thread.start_new_thread(getNextScreen, ())</p>
<h1>screen.clean_screen()</h1>
<h1>screen.load_screen(screen1)</h1>
<h1>screen.load_screen(screens[2])</h1>
<p dir="auto">pass<br />
btnC.wasPressed(buttonC_wasPressed)</p>
<p dir="auto">The formatting here is terrible, as it reads # for markdown...</p>
<p dir="auto">I will put my code on github (hjgode) later on</p>
<p dir="auto">BTW: the UIFlow doc is a mess. They use // in fron of line for a python comment line (needs to be a # in front). And I am missing examples, examples....<br />
Still looking for a complete developer doc for the UIFlow micropython stuff. Some functions are named differently and some just do not work, if you try the micropython basic ones (like for example umqtt.simple, which just crashes as someone forget to implement socket.set_timeout)</p>
]]></description><link>https://community.m5stack.com/post/14623</link><guid isPermaLink="true">https://community.m5stack.com/post/14623</guid><dc:creator><![CDATA[Josef]]></dc:creator><pubDate>Thu, 12 Aug 2021 17:55:27 GMT</pubDate></item><item><title><![CDATA[Reply to [UiFlow] The ability to display multiple &quot;screens&quot; or &quot;cards&quot; on Mon, 19 Jul 2021 05:26:09 GMT]]></title><description><![CDATA[<p dir="auto">I did several versions back but lost the code but IIRC I created seperate function for each screen with a clear screen block before defining the new screen.<br />
When a button is pressed or function triggered, the screen function gets called.</p>
]]></description><link>https://community.m5stack.com/post/14444</link><guid isPermaLink="true">https://community.m5stack.com/post/14444</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Mon, 19 Jul 2021 05:26:09 GMT</pubDate></item><item><title><![CDATA[Reply to [UiFlow] The ability to display multiple &quot;screens&quot; or &quot;cards&quot; on Mon, 19 Jul 2021 04:02:30 GMT]]></title><description><![CDATA[<p dir="auto">Are you able to build some code that allows you to switch between screens? If so would you mind sharing? I am currently trying to work out how you could set up multiple screens as well. NGL I'm a newb so sorry if I am asking for some basic stuff over here.</p>
]]></description><link>https://community.m5stack.com/post/14443</link><guid isPermaLink="true">https://community.m5stack.com/post/14443</guid><dc:creator><![CDATA[pumpkinetcher]]></dc:creator><pubDate>Mon, 19 Jul 2021 04:02:30 GMT</pubDate></item><item><title><![CDATA[Reply to [UiFlow] The ability to display multiple &quot;screens&quot; or &quot;cards&quot; on Mon, 19 Jul 2021 04:00:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a> This is what my bud and I have been talking about today. I figured this would be the work around since there isn't a dedicated "screen" block.</p>
<p dir="auto">I haven't figured out how to implement it quite yet, as I am still learning the basics of the device and the language.</p>
]]></description><link>https://community.m5stack.com/post/14442</link><guid isPermaLink="true">https://community.m5stack.com/post/14442</guid><dc:creator><![CDATA[pumpkinetcher]]></dc:creator><pubDate>Mon, 19 Jul 2021 04:00:46 GMT</pubDate></item><item><title><![CDATA[Reply to [UiFlow] The ability to display multiple &quot;screens&quot; or &quot;cards&quot; on Tue, 01 Jun 2021 01:25:25 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/davec" aria-label="Profile: DaveC">@<bdi>DaveC</bdi></a> ,<br />
I understand your thoughts. This feature is indeed very practical. We are also investigating how to implement it. It may not be launched soon. I think we will launch this feature at the right time.<br />
The main problem at present is that we may need to unify the GUI framework of all devices.<br />
This may take a long time.</p>
]]></description><link>https://community.m5stack.com/post/13965</link><guid isPermaLink="true">https://community.m5stack.com/post/13965</guid><dc:creator><![CDATA[IAMLIUBO]]></dc:creator><pubDate>Tue, 01 Jun 2021 01:25:25 GMT</pubDate></item><item><title><![CDATA[Reply to [UiFlow] The ability to display multiple &quot;screens&quot; or &quot;cards&quot; on Mon, 31 May 2021 07:56:25 GMT]]></title><description><![CDATA[<p dir="auto">Currently you could define separate screens as separate functions that are called buy actions however a dedicated "screen" block would be handy.</p>
]]></description><link>https://community.m5stack.com/post/13959</link><guid isPermaLink="true">https://community.m5stack.com/post/13959</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Mon, 31 May 2021 07:56:25 GMT</pubDate></item></channel></rss>