Adding things to every screen
Is there a trick for adding lets say logo and other such things to every screen without adding a controler to each screen you write?
Submitted by Terje Pedersen on 22 June 2011 at 10:39
Issue Log
Not only a logo, that could have been managed by CSS, but also button() ie a custom control with more mobl stuff in
You could try something like this:
screen mainScreen() {
header(“Hello!”)
button(“Next”, onclick={
nextScreen();
})
}screen nextScreen() {
header(“Yep”) {
backButton()
}
}screen root() {
“Insert logo here”
screenContext {
“Loading…”
script {
async {
sleep(100);
mainScreen(animate=“none”);
}
}
}
}The
screenContext
control defines what is the new “full screen”. Anything outside this area will remain unchanged, this is used with the tabSet control for instance. The root screen defines the general layout of the screen, the screenContext container is the part of the screen that changes (in this case, by quickly calling another screen, but you could also just put any controls you like there.
Thanks :-) Works great :-)
Log in to post comments