Page 1 of 1
numbers at top of smartBasic app title
Posted: Sat Apr 15, 2017 7:25 pm
by Elliot
What are the numbers to the right of my program title in my smartBasic iphone app? They are in the wood-grained box at the top: TitleOfApp 15:2. How can I get rid of them?
Thanks.
Elliot
Re: numbers at top of smartBasic app title
Posted: Sun Apr 16, 2017 5:19 am
by rbytes
Those numbers are the time and the remaining percentage of battery charge.
The clock displays 24 hour time, so 8:00 pm will show as 20:00.
You can use the code below to show or hide the numbers. Put apostrophes
at the start of the commands you don't want to execute.
Code: Select all
'SET TOOLBAR TIME OFF
SET TOOLBAR TIME ON
'SET TOOLBAR BATTERY OFF
SET TOOLBAR BATTERY ON
Re: numbers at top of smartBasic app title
Posted: Sun Apr 16, 2017 3:13 pm
by Elliot
Thanks!
Re: Remove toolbar
Posted: Sun Apr 16, 2017 4:10 pm
by Elliot
If I turn the toolbar completely off, how do I get back to the code?
Thanks.
Re: numbers at top of smartBasic app title
Posted: Sun Apr 16, 2017 5:51 pm
by rbytes
There is no easy way to exit without a Quit button, but there is a way. Double-click your home button, look for the smart Basic app (displaying your running program) among the other apps and swipe it off the screen. This is the same way you would close an app running in the background. When you start smart Basic again, it will not remember where you were, so you will have to navigate to the folder you were working in and click your app again to continue editing.
A much better solution is to create your own stop button. There are lots of examples in Basic Programs as to how to do this. It really only takes two steps:
1. Create your stop button - name it "Stop", "Quit" or any other name you want.
2. Then add a line in the main program IF BUTTON_CLICKED ("Stop") THEN END
Usually after setting up your interface, you make a loop of your main program:
DO
IF BUTTON_CLICKED ("Hello") then print "Hello!"
IF BUTTON_CLICKED ("Goodbye") then print "Farewell!"
IF BUTTON_CLICKED ("Quit") THEN END
SLOWDOWN
UNTIL 0
The do ... until cycle will loop forever, with every button ready to detect and perform a task. But the loops happen so fast, you will actually notice your device gradually heating up, and the battery level dropping, because you are running your CPU at close to 100%
So the final thing you do is add SLOWDOWN, which pauses the CPU each loop, enough to drop its load to a normal level. SLOWDOWN can be placed either just after the DO or just before the UNTIL 0. Don't use it more than once in a loop or your program may get laggy.
Re: numbers at top of smartBasic app title
Posted: Sun Apr 16, 2017 5:56 pm
by rbytes
I should have mentioned that SET TOOLBAR OFF turns off the toolbar only while your code is running. While it is stopped and you are in the editor, you can not shut the entire toolbar off, just the clock and battery level display.
Re: numbers at top of smartBasic app title
Posted: Tue Apr 18, 2017 8:05 pm
by GeorgeMcGinn
Dav awhile back wrote a routine that replaces the toolbar with a cool version of it for running apps.
You can find the code and the posts at:
viewtopic.php?f=20&t=954&hilit=Drawinfobar
The transparent version is the most popular as it looks more professional and gives you access to the full screen and a small info bar where, as you read the posts, others have added other features to it to suit their needs.
There are several examples of the code, so pick the one that looks like it will meet your needs. Rbytes and I use it a lot, but RBytes has more programs using it than I do.
George.
Elliot wrote: ↑Sat Apr 15, 2017 7:25 pm
What are the numbers to the right of my program title in my smartBasic iphone app? They are in the wood-grained box at the top: TitleOfApp 15:2. How can I get rid of them?
Thanks.
Elliot