.. _crash_course: ############ Crash course ############ This is a crash course on writing apps for ZPUI, with links to more in-depth explanations. ====== Basics ====== - What does a "do nothing" ZPUI app need? :ref:`One directory with two files and 5 lines of code ` - What does a "Hello, world" app need? :ref:`One more line of code. ` - Can you do an app as an object? :ref:`Sure, here's how. ` - Want a walkthrough for writing an app drawing things on the screen? :doc:`Sure, here's a guide. ` - Want to experiment with the code using REPL? :ref:`Use the sandbox. ` ============================ Showing things on the screen ============================ - Want to display some text real quick and dirty? Use ``o.display_data("first_line", "second_line", "third_line"...)``. - Want to display some text in a more user-friendly fashion, with UX bells&whistles? Use PrettyPrinter. - Want to display an image? :ref:`Use display_image. ` - Want to display an image in a more user-friendly fashion, with UX bells&whistles? :ref:`Use GraphicsPrinter. ` - Want to construct an image dynamically? :ref:`Use Canvas. ` ============= Interactivity ============= - Want some *very* basic interactivity? Setup some input callbacks and start an input thread. - How do callbacks work, what's a keymap and how do you set one? :doc:`Read here. ` - Want to make a very basic loop and allow the user to interrupt it? :ref:`Use ExitHelper. ` - Want to make a menu for your application? Use a Menu. - Want to make a "pick any items out of many and accept" choice? :ref:`Use a Checkbox. ` - Want to make a "pick one out of many" choice? :ref:`Use a Listbox. ` - Want to make a "Yes"/"No"[/"Cancel"] choice? :ref:`Use DialogBox. ` - Want to make a status screen? Use a Refresher. - Want to input some text? Use UniversalInput. - Want to adjust a number? Use IntegerAdjustInput. - Want to pick a directory/file? :ref:`Use PathPicker. ` - Want to pick a date from the calendar? Use DatePicker. - Want to pick a time? Use TimePicker. - Want to show a lot of text on the screen? Use TextReader. - Want to indicate that some task is in progress? :ref:`Use LoadingBar. ` - Want to indicate a task is in progress, with a progress estimate? :ref:`Use ProgressBar. ` - Want to make an UI element react to more buttons? :ref:`Here's how you do that. ` ============= App internals ============= - Want to add logging? It's very easy - :ref:`here's a snippet for adding logging. ` - Want to include some resource files with your app - i.e. sounds? :ref:`Here's how to access them the proper way. ` - Want to have a place to store variables for your app? :ref:`Here's a snippet to use a config file. ` - Want to learn about things you should do while writing an app? We have some guidelines :ref:`here ` and :ref:`here `. - Want to learn about things you should *not* do while writing an app? :ref:`Here are some more examples. ` - Want to run things on app startup/launch/in the background? :ref:`Here are the basics of that. `