hello world
This commit is contained in:
commit
d03b458b68
3
README.md
Normal file
3
README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Hello World dialog
|
||||
|
||||
A simple beginning - displays a message with preset text.
|
11
application.fam
Normal file
11
application.fam
Normal file
@ -0,0 +1,11 @@
|
||||
App(
|
||||
appid="hello_world",
|
||||
name="Hello World",
|
||||
apptype=FlipperAppType.PLUGIN,
|
||||
entry_point="hello_world_app",
|
||||
cdefines=["APP_HELLO_WORLD"],
|
||||
requires=["gui"],
|
||||
stack_size=1 * 1024,
|
||||
icon="A_Plugins_14",
|
||||
order=35,
|
||||
)
|
30
helloworld.c
Normal file
30
helloworld.c
Normal file
@ -0,0 +1,30 @@
|
||||
#include <furi.h>
|
||||
#include <dialogs/dialogs.h>
|
||||
|
||||
typedef struct {
|
||||
DialogsApp* dialogs;
|
||||
} HelloWorld;
|
||||
|
||||
int32_t hello_world_app(void* p) {
|
||||
UNUSED(p);
|
||||
HelloWorld* helloworld = malloc(sizeof(HelloWorld));
|
||||
helloworld->dialogs = furi_record_open(RECORD_DIALOGS);
|
||||
DialogMessage* message = dialog_message_alloc();
|
||||
|
||||
const char* header_text = "Hello world";
|
||||
const char* message_text = "Panki's first C program!";
|
||||
|
||||
dialog_message_set_header(message, header_text, 63, 3, AlignCenter, AlignTop);
|
||||
dialog_message_set_text(message, message_text, 0, 17, AlignLeft, AlignTop);
|
||||
|
||||
dialog_message_set_icon(message, &I_DolphinCommon_56x48, 72, 17);
|
||||
|
||||
dialog_message_show(helloworld->dialogs, message);
|
||||
|
||||
dialog_message_free(message);
|
||||
furi_record_close(RECORD_DIALOGS);
|
||||
free(helloworld);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user