You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
915 B
36 lines
915 B
#include "watchos.h"
|
|
#include "Module_UI.h"
|
|
|
|
class Task_Test : public IRunnable, public IDrawable, public Task, public EventListener
|
|
{
|
|
Module_UI* ui = nullptr;
|
|
kernel_handle_t window_handle;
|
|
|
|
public:
|
|
Task_Test()
|
|
{
|
|
watchos::subscribe(this, 0xffffffffffffffffu, 0xffffu);
|
|
ui = static_cast<Module_UI*>(watchos::module(WATCHOS_MODULE_UI));
|
|
ui->setLayoutMode(ui->getRoot(), MODULE_UI_LAYOUT_MODE_SPLIT_HORIZONTAL);
|
|
|
|
window_handle = ui->createWindow(this, ui->getRoot());
|
|
ui->createWindow(ui->getRoot());
|
|
}
|
|
void tick()
|
|
{
|
|
Event* e;
|
|
while (this->hasEvent())
|
|
{
|
|
e = this->getEvent();
|
|
|
|
watchos::debug("Got event: src %#020llx evt %#06x param1 %#04x param2 %#04x", e->source, e->event, e->param1, e->param2);
|
|
|
|
this->popEvent();
|
|
}
|
|
}
|
|
void draw(kernel_handle_t handle)
|
|
{
|
|
ui->fill(COLOUR_SECONDARY);
|
|
ui->print(0, ui->getHeight(), "Hello, world!");
|
|
}
|
|
};
|