انتقل للمحتوى
Robo EgyptRobo Egypt
☰ Course contents

Your first event: two buttons and two colours

Section 1: The start: your first appLesson 1.3 · ⏱ 10 min
🎯 Project goal
The “Morning ☀️” button writes “Good morning” and makes the screen yellow, and the “Evening 🌙” button writes “Good evening” and makes it dark blue.
The two buttons are inside a “Horizontal” layout so they sit side by side
The two buttons are inside a “Horizontal” layout so they sit side by side
Each button has its own event: three blocks in each event
Each button has its own event: three blocks in each event
After tapping “Morning ☀️”
After tapping “Morning ☀️”
After tapping “Evening 🌙”
After tapping “Evening 🌙”
  • set color of Label1 changes the colour of the words, because dark blue words don't show on a dark blue screen.
  • 🎨 set screen colour to changes the background of the whole app.
  1. Add a third button “Noon 🌤” in another colour.

📌 Another example: three buttons and three colours

Each button colours the screen in its colour.

The design
The design
The blocks
The blocks
In the lab: after “Red”
In the lab: after “Red”
✍️ Practise
The challenge: your first working app.
✍️ Practise here in the lessonor open the lab in a new page ↗
✍️ Practise
Practice: two buttons and two messages.
✍️ Practise here in the lessonor open the lab in a new page ↗

🎯 Challenge yourself

Easy

A button that changes the colour of the words to red.

👀 Show the solution
The design
The design
The blocks
The blocks
In the lab
In the lab

Result: the words became red.

Medium

A button that hides the picture, and another button that shows it.

👀 Show the solution
The design
The design
The blocks
The blocks
In the lab
In the lab

Result: the picture disappeared.

Hard

A traffic light: three buttons change the big light and the screen colour.

👀 Show the solution
The design
The design
The blocks
The blocks
In the lab
In the lab

Result: the light is green.

Finished the lesson? Mark it so your progress counts.