numbers at top of smartBasic app title

Post Reply
Elliot
Posts: 37
Joined: Thu Jun 23, 2016 10:58 am
My devices: iphone
ipad
PC
Flag: United States of America

numbers at top of smartBasic app title

Post 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

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: numbers at top of smartBasic app title

Post 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
The only thing that gets me down is gravity...

Elliot
Posts: 37
Joined: Thu Jun 23, 2016 10:58 am
My devices: iphone
ipad
PC
Flag: United States of America

Re: numbers at top of smartBasic app title

Post by Elliot »

Thanks!

Elliot
Posts: 37
Joined: Thu Jun 23, 2016 10:58 am
My devices: iphone
ipad
PC
Flag: United States of America

Re: Remove toolbar

Post by Elliot »

If I turn the toolbar completely off, how do I get back to the code?

Thanks.

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: numbers at top of smartBasic app title

Post 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.
The only thing that gets me down is gravity...

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: numbers at top of smartBasic app title

Post 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.
The only thing that gets me down is gravity...

User avatar
GeorgeMcGinn
Posts: 435
Joined: Sat Sep 10, 2016 6:37 am
My devices: IPad Pro 10.5in
IMac
Linux i386
Windows 7 & 10
Location: Venice, FL
Flag: United States of America
Contact:

Re: numbers at top of smartBasic app title

Post 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
George McGinn
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)

Post Reply