<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to NEW_MAIN_EXAMPLE</title><link>https://sourceforge.net/p/pirobot/wiki/NEW_MAIN_EXAMPLE/</link><description>Recent changes to NEW_MAIN_EXAMPLE</description><atom:link href="https://sourceforge.net/p/pirobot/wiki/NEW_MAIN_EXAMPLE/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 28 May 2024 18:07:38 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/pirobot/wiki/NEW_MAIN_EXAMPLE/feed" rel="self" type="application/rss+xml"/><item><title>NEW_MAIN_EXAMPLE modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/NEW_MAIN_EXAMPLE/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -13,7 +13,7 @@
 ~~~
 {
    "Apps": [
-       "Apps.APP_Face",
+       "Apps.APP_Draw",
        "Apps.Games.APP_GAME_TicTacToe",
         ...
    ]
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Tue, 28 May 2024 18:07:38 -0000</pubDate><guid>https://sourceforge.net200e02035c78dc9a14ea8246beb0265e836a7204</guid></item><item><title>NEW_MAIN_EXAMPLE modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/NEW_MAIN_EXAMPLE/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -39,3 +39,7 @@

 APP_BASE.quit()
 ~~~
+
+---------
+
+If you know how MAIN.py works now, learn how to create one of these shiny Apps for yourself with the [APP_TEMPLATE].
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Tue, 28 May 2024 18:04:22 -0000</pubDate><guid>https://sourceforge.neta855b6e67a601cc7da758505b005593e0d09963d</guid></item><item><title>NEW_MAIN_EXAMPLE modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/NEW_MAIN_EXAMPLE/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -33,8 +33,9 @@
 APP_MENU.CURRENT_MENU=mainMenu
 APP_BASE.setCurrentApp("APP_MENU")

-while(done==False):
-    done=APP_BASE.update()
+running=True
+while running==True:
+     running=APP_BASE.update()

 APP_BASE.quit()
 ~~~
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Tue, 28 May 2024 18:04:05 -0000</pubDate><guid>https://sourceforge.netd0accda474052f0d0f58cfe91a65bf05237a1d43</guid></item><item><title>NEW_MAIN_EXAMPLE modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/NEW_MAIN_EXAMPLE/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="main-the-new-way-of-doing-it"&gt;MAIN - The new way of doing it.&lt;/h1&gt;
&lt;p&gt;The new way requires two files to run:&lt;br/&gt;
AppList.json and MAIN.py (and all the Apps, of course.)&lt;/p&gt;
&lt;p&gt;In AppList.json are all the modules listed like if you import them.&lt;/p&gt;
&lt;p&gt;The Path is relative to the main file and you need points (.) instead of slashes (/).&lt;/p&gt;
&lt;p&gt;Here is an example:&lt;/p&gt;
&lt;p&gt;AppList.json&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;{
   "Apps": [
       "Apps.APP_Face",
       "Apps.Games.APP_GAME_TicTacToe",
        ...
   ]
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And then in the main file, you just need to call "initialize" and then you can create a menu with the apps:&lt;/p&gt;
&lt;p&gt;MAIN.py&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;APP_BASE&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;APP_MENU&lt;/span&gt;

&lt;span class="n"&gt;APP_BASE&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;# this imports all apps listed in AppList.json&lt;/span&gt;
&lt;span class="n"&gt;mainMenu&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;APP_MENU&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;createAppMenu&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;# this creates a menu with the imported Apps.&lt;/span&gt;

&lt;span class="n"&gt;APP_MENU&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CURRENT_MENU&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;mainMenu&lt;/span&gt;
&lt;span class="n"&gt;APP_BASE&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setCurrentApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"APP_MENU"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;done&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;done&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;APP_BASE&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;APP_BASE&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;quit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Tue, 28 May 2024 18:02:05 -0000</pubDate><guid>https://sourceforge.netb735a2fea23d239934be02081c18aa4f95ac3a36</guid></item></channel></rss>