-
-
Save lauromoura/44c130a3102a2274b404 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Copyright (C) 2008-2014 Expersite Solutions | |
// | |
// author: Lauro Moura | |
// email: lauromoura@expertisesolutions.com.br | |
// Based on work of Larry Lira | |
// email: larry@expertisesolutions@gmail.com.br | |
function addWidget(f, parent, bx) { | |
var widget = new f(parent); | |
widget.visibility_set(true); | |
bx.pack_end(widget); | |
return widget; | |
} | |
function button_click() { | |
console.log("Hello, world!"); | |
} | |
elm = require('elm'); | |
efl = require('efl'); | |
var win = new elm.Elm_Win (null, 'name', 0); | |
win.title_set('EFl JS Hello World'); | |
win.autodel_set(true); | |
var bg = new elm.Elm_Bg (win); | |
bg.size_hint_weight_set(1.0, 1.0); | |
win.resize_object_add(bg); | |
bg.visibility_set(true); | |
box = new elm.Elm_Box(win); | |
box.size_hint_weight_set(1.0, 1.0); | |
win.resize_object_add(box); | |
// t1 = addWidget(elm.Elm_Label, win, box); | |
// t1.text_set(null, "Hi there"); | |
// t1.size_hint_weight_set(1.0, 1.0); | |
// t1.size_hint_align_set(-1.0, -1.0); | |
bt = addWidget(elm.Elm_Button, win, box); | |
bt.text_set("elm.text", "Click me!"); | |
bt.event_clicked(button_click); | |
win.size_set(320,240); | |
box.visibility_set(true); | |
win.visibility_set(true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment