Skip to content

Instantly share code, notes, and snippets.

@rkrishnasanka
Created July 12, 2014 16:42
Show Gist options
  • Save rkrishnasanka/9812a07c06adc24a2a46 to your computer and use it in GitHub Desktop.
Save rkrishnasanka/9812a07c06adc24a2a46 to your computer and use it in GitHub Desktop.
#include "pebble_os.h"
#include "pebble_app.h"
#include "pebble_fonts.h"
#define MY_UUID { 0x39, 0x20, 0xBF, 0x15, 0xE4, 0xDA, 0x4E, 0x77, 0x9C, 0xDB, 0x3E, 0xD1, 0xCB, 0x6F, 0x28, 0xFB }
PBL_APP_INFO(MY_UUID,
"Hello World App", "ElctronicsMadeEasy",
1, 0, /* App version */
DEFAULT_MENU_ICON,
APP_INFO_STANDARD_APP);
Window window;
TextLayer hello_layer;
void handle_init(AppContextRef ctx) {
(void)ctx;
window_init(&window, "Window Name");
window_stack_push(&window, true /* Animated */);
window_set_background_color(&window, GColorWhite);
text_layer_init(&hello_layer, GRect(0, 65, 144, 30));
text_layer_set_text_alignment(&hello_layer, GTextAlignmentCenter);
text_layer_set_background_color(&hello_layer, GColorBlack);
text_layer_set_text(&hello_layer, "Hello world!");
text_layer_set_font(&hello_layer, fonts_get_system_font(FONT_KEY_ROBOTO_CONDENSED_21));
text_layer_set_text_color(&hello_layer, GColorWhite);
layer_add_child(&window.layer, &hello_layer.layer);
}
void pbl_main(void *params) {
PebbleAppHandlers handlers = {
.init_handler = &handle_init
};
app_event_loop(params, &handlers);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment