forked from enlightenment/efl
js: Update examples, including window api changes.
Window now inherits from Container instead of Pack. Also removed some deprecated stuff.
This commit is contained in:
parent
26f6254225
commit
eb041fb6a0
|
@ -8,7 +8,7 @@ win.setAutohide(true);
|
|||
bg = new efl.Elm.Bg(win);
|
||||
bg.setColor(255, 0,0,255)
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.pack(bg);
|
||||
win.setContent(bg);
|
||||
bg.setVisible(true);
|
||||
|
||||
win.setSize(320,320);
|
||||
|
|
|
@ -12,7 +12,7 @@ bg.setOption(efl.Elm.Bg.Option.CENTER);
|
|||
//TODO: elm_app_data_dir_get
|
||||
bg.setFile(__dirname + '/../../../data/elementary/images/plant_01.jpg', null);
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.pack(bg);
|
||||
win.setContent(bg);
|
||||
bg.setVisible(true);
|
||||
|
||||
win.setSize(320, 320);
|
||||
|
|
|
@ -7,12 +7,12 @@ win.setAutohide(true);
|
|||
|
||||
bg = new efl.Elm.Bg(win);
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.pack(bg);
|
||||
win.setContent(bg);
|
||||
bg.setVisible(true);
|
||||
|
||||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
win.pack(bx);
|
||||
win.setContent(bx);
|
||||
|
||||
entry = new efl.Elm.Label(win);
|
||||
entry.setSize(100, 100);
|
||||
|
|
|
@ -21,14 +21,9 @@ win = new efl.Efl.Ui.Win.Standard(null);
|
|||
win.setText("Box example");
|
||||
win.setAutohide(true);
|
||||
|
||||
bg = new efl.Elm.Bg(win);
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.pack(bg);
|
||||
bg.setVisible(true);
|
||||
|
||||
bigbox = new efl.Efl.Ui.Box(win)
|
||||
bigbox.setHintWeight(1.0, 1.0);
|
||||
win.pack(bigbox);
|
||||
win.setContent(bigbox);
|
||||
|
||||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
|
||||
efl = require('efl');
|
||||
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Bg Plain");
|
||||
win.setAutohide(true);
|
||||
|
||||
bg = new efl.Elm.Bg(win);
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.pack(bg);
|
||||
bg.setVisible(true);
|
||||
|
||||
label1 = new efl.Elm.Label(win);
|
||||
label1.setText(null, "Bubble with icon, info and label");
|
||||
label1.setVisible(true);
|
||||
|
||||
console.log(efl);
|
||||
|
||||
icon = new efl.Efl.Canvas.Rectangle(win);
|
||||
icon.setColor( 0, 0, 255, 255);
|
||||
icon.setVisible(true);
|
||||
|
||||
bubble1 = new efl.Elm.Bubble(win);
|
||||
icon_eo = bubble1.part("icon");
|
||||
icon_container = icon_eo.cast("Efl.Container");
|
||||
icon_container.setContent(icon);
|
||||
bubble1.setText("info", "INFO");
|
||||
bubble1.setText(null, "LABEL");
|
||||
bubble1.setContent(label1);
|
||||
bubble1.setSize(300, 100);
|
||||
bubble1.setVisible(true);
|
||||
|
||||
corner = 0;
|
||||
bubble1.on('clicked',
|
||||
function()
|
||||
{
|
||||
++corner;
|
||||
if (corner > 3)
|
||||
bubble1.setPos(corner = 0);
|
||||
else
|
||||
bubble1.setPos(corner);
|
||||
});
|
||||
|
||||
label2 = new efl.Elm.Label(win);
|
||||
label2.setText(null, "Bubble with no icon, info or label");
|
||||
label2.setVisible(true);
|
||||
|
||||
bubble2 = new efl.Elm.Bubble(win);
|
||||
bubble2.setContent(label2);
|
||||
bubble2.setSize(200, 50);
|
||||
bubble2.setPosition(0, 110);
|
||||
bubble2.setVisible(true);
|
||||
|
||||
win.setSize(300, 200);
|
||||
win.setVisible(true);
|
|
@ -35,7 +35,7 @@ _btn_cursors_move = function(_btn) {
|
|||
console.log ("cursor move: ", size[0], size[1]);
|
||||
|
||||
if (!icon_still) {
|
||||
var icon = new efl.Elm.Icon(mid);
|
||||
var icon = new efl.Efl.Ui.Image(mid);
|
||||
var icon_still_p = mid.contentUnset("icon");
|
||||
if (icon_still_p) {
|
||||
icon_still_p.setVisible(false);
|
||||
|
@ -68,7 +68,7 @@ win = new efl.Efl.Ui.Win.Standard(null);
|
|||
win.setText("Button example");
|
||||
win.setAutohide(true);
|
||||
|
||||
icon_still = new efl.Elm.Icon(win);
|
||||
icon_still = new efl.Efl.Ui.Image(win);
|
||||
mid = new efl.Elm.Button(win);
|
||||
up = new efl.Elm.Button(win);
|
||||
down = new efl.Elm.Button(win);
|
||||
|
@ -85,7 +85,7 @@ _btn_cursors_release = function() {
|
|||
|
||||
box = new efl.Efl.Ui.Box(win);
|
||||
box.setHintWeight(1.0, 1.0);
|
||||
win.pack(box);
|
||||
win.setContent(box);
|
||||
box.setVisible(true);
|
||||
|
||||
box_initial = new efl.Efl.Ui.Box(win);
|
||||
|
@ -146,7 +146,7 @@ box.packEnd(up);
|
|||
up.setVisible(true);
|
||||
up.on('repeated', _btn_cursors_move)
|
||||
up.on('unpressed', _btn_cursors_release);
|
||||
icon_up = new efl.Elm.Icon(win);
|
||||
icon_up = new efl.Efl.Ui.Image(win);
|
||||
icon_up.setIcon("arrow_up");
|
||||
setIcon(up, icon_up);
|
||||
|
||||
|
@ -167,7 +167,7 @@ left.setVisible(true);
|
|||
left.on('repeated', _btn_cursors_move)
|
||||
left.on('unpressed', _btn_cursors_release);
|
||||
|
||||
icon_left = new efl.Elm.Icon(win);
|
||||
icon_left = new efl.Efl.Ui.Image(win);
|
||||
icon_left.setIcon("arrow_left");
|
||||
setIcon(left, icon_left);
|
||||
|
||||
|
@ -175,7 +175,7 @@ mid.setHintWeight(1.0, 1.0);
|
|||
box_inferior.packEnd(mid);
|
||||
mid.setVisible(true);
|
||||
|
||||
icon_mid = new efl.Elm.Icon(win);
|
||||
icon_mid = new efl.Efl.Ui.Image(win);
|
||||
icon_mid.setIcon("close");
|
||||
setIcon(mid, icon_mid);
|
||||
|
||||
|
@ -189,7 +189,7 @@ right.setVisible(true);
|
|||
right.on('repeated', _btn_cursors_move);
|
||||
right.on('unpressed', _btn_cursors_release);
|
||||
|
||||
icon_right = new efl.Elm.Icon(win);
|
||||
icon_right = new efl.Efl.Ui.Image(win);
|
||||
icon_right.setIcon("arrow_right");
|
||||
setIcon(right, icon_right);
|
||||
|
||||
|
@ -203,7 +203,7 @@ down.setVisible(true);
|
|||
down.on('repeated', _btn_cursors_move);
|
||||
down.on('unpressed', _btn_cursors_release);
|
||||
|
||||
icon_down = new efl.Elm.Icon(win);
|
||||
icon_down = new efl.Efl.Ui.Image(win);
|
||||
icon_down.setIcon("arrow_down");
|
||||
setIcon(down, icon_down);
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ win.setAutohide(true);
|
|||
|
||||
cal = new efl.Elm.Calendar(win);
|
||||
cal.setHintWeight(1.0, 1.0);
|
||||
win.pack(cal);
|
||||
win.setContent(cal);
|
||||
win.setSize(240, 240);
|
||||
cal.setVisible(true);
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ win.setAutohide(true);
|
|||
cal = new efl.Elm.Calendar(win);
|
||||
cal.setHintWeight(1.0, 1.0);
|
||||
|
||||
win.pack(cal);
|
||||
win.setContent(cal);
|
||||
win.setSize(240, 240);
|
||||
//cal.format_function_set(funtion);
|
||||
//cal.weekdays_names_set(weekdays);
|
||||
|
|
|
@ -7,9 +7,10 @@ win.setAutohide(true);
|
|||
|
||||
cal = new efl.Elm.Calendar(win);
|
||||
cal.setHintWeight(1.0, 1.0);
|
||||
win.pack(cal);
|
||||
win.setContent(cal);
|
||||
win.setSize(240, 240);
|
||||
cal.setMinMaxYear(2020,2022);
|
||||
// FIXME Add support to Efl.Time and Efl.Ui.Calendar
|
||||
// cal.setMinMaxYear(2020,2022);
|
||||
cal.setVisible(true);
|
||||
|
||||
win.setVisible(true);
|
||||
|
|
|
@ -7,14 +7,13 @@ win.setAutohide(true);
|
|||
|
||||
box = new efl.Efl.Ui.Box(win);
|
||||
box.setHintWeight(1.0, 1.0);
|
||||
win.pack(box);
|
||||
win.setContent(box);
|
||||
box.setVisible(true);
|
||||
|
||||
cal = new efl.Elm.Calendar(win);
|
||||
cal.setHintWeight(1.0, 1.0);
|
||||
cal.setHintAlign(-1.0, -1.0);
|
||||
cal.setSelectMode(efl.Elm.Calendar.Select.Mode.NONE);
|
||||
win.pack(cal);
|
||||
cal.setVisible(true);
|
||||
box.packEnd(cal);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ win.setAutohide(true);
|
|||
|
||||
cal = new efl.Elm.Calendar(win);
|
||||
cal.setHintWeight(1.0, 1.0);
|
||||
win.pack(cal);
|
||||
win.setContent(cal);
|
||||
win.setSize(240, 240);
|
||||
|
||||
cal.on('changed', _print_cal_info_cb);
|
||||
|
|
|
@ -7,7 +7,7 @@ win.setSize(480, 240);
|
|||
|
||||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
win.pack(bx);
|
||||
win.setContent(bx);
|
||||
bx.setVisible(true);
|
||||
bx.setOrientation(efl.Efl.Orient.VERTICAL);
|
||||
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
|
||||
efl = require('efl');
|
||||
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Datetime");
|
||||
win.setAutohide(true);
|
||||
win.setSize(320,240);
|
||||
|
||||
bg = new efl.Elm.Bg(win);
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.pack(bg);
|
||||
bg.setVisible(true);
|
||||
|
||||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
win.pack(bx);
|
||||
bx.setVisible(true);
|
||||
|
||||
datetime = new efl.Elm.Datetime(bx);
|
||||
datetime.setHintWeight(1.0, 1.0);
|
||||
datetime.setHintAlign(-1.0, 0.5);
|
||||
datetime.setFieldVisible(efl.Elm.Datetime.FieldType.HOUR, false);
|
||||
datetime.setFieldVisible(efl.Elm.Datetime.FieldType.MINUTE, false);
|
||||
datetime.setFieldVisible(efl.Elm.Datetime.FieldType.AMPM, false);
|
||||
bx.packEnd(datetime);
|
||||
datetime.setVisible(true);
|
||||
|
||||
datetime = new efl.Elm.Datetime(bx);
|
||||
datetime.setHintWeight(1.0, 1.0);
|
||||
datetime.setHintAlign(-1.0, 0.5);
|
||||
datetime.setFieldVisible(efl.Elm.Datetime.FieldType.YEAR, false);
|
||||
datetime.setFieldVisible(efl.Elm.Datetime.FieldType.MONTH, false);
|
||||
datetime.setFieldVisible(efl.Elm.Datetime.FieldType.DATE, false);
|
||||
bx.packEnd(datetime);
|
||||
datetime.setVisible(true);
|
||||
|
||||
datetime = new efl.Elm.Datetime(bx);
|
||||
datetime.setHintWeight(1.0, 1.0);
|
||||
datetime.setHintAlign(-1.0, 0.5);
|
||||
bx.packEnd(datetime);
|
||||
datetime.setVisible(true);
|
||||
|
||||
win.setVisible(true);
|
|
@ -5,9 +5,9 @@ win = new efl.Efl.Ui.Win.Standard(null);
|
|||
win.setText("Icon Plain");
|
||||
win.setAutohide(true);
|
||||
|
||||
icon = new efl.Elm.Icon(win);
|
||||
icon = new efl.Efl.Ui.Image(win);
|
||||
//icon.order_lookup_set(ELM_ICON_LOOKUP_THEME_FDO); Ja eh o default
|
||||
icon.setStandard("home");
|
||||
icon.setIcon("home");
|
||||
|
||||
var path, group;
|
||||
r = icon.getFile(path, group);
|
||||
|
@ -16,16 +16,13 @@ gruop = r[1];
|
|||
console.log("path = " + path + ", group = " + group);
|
||||
|
||||
var name;
|
||||
name = icon.getStandard();
|
||||
name = icon.getIcon();
|
||||
console.log("name = " + name);
|
||||
|
||||
icon.setNoScale(true);
|
||||
icon.setResizable(false, true);
|
||||
icon.setSmooth(false);
|
||||
icon.setFillOutside(true);
|
||||
icon.setScaleType(efl.Efl.Ui.Image.ScaleType.NONE);
|
||||
|
||||
icon.setHintWeight(1.0, 1.0);
|
||||
win.pack(icon);
|
||||
win.setContent(icon);
|
||||
icon.setVisible(true);
|
||||
|
||||
win.setSize(320, 320);
|
||||
|
|
|
@ -9,7 +9,7 @@ win.setAutohide(true);
|
|||
|
||||
box = new efl.Efl.Ui.Box(win);
|
||||
box.setHintWeight(1.0, 1.0);
|
||||
win.pack(box);
|
||||
win.setContent(box);
|
||||
box.setVisible(true);
|
||||
|
||||
ly = new Elm.Layout(box);
|
||||
|
@ -25,7 +25,7 @@ ly.setHintAlign(1.0, 1.0);
|
|||
box.packEnd(ly);
|
||||
ly.setVisible(true);
|
||||
|
||||
bt = new Elm.Icon(ly);
|
||||
bt = new efl.Efl.Ui.Image(ly);
|
||||
bt.setIcon('chat');
|
||||
bt.setHintMin(20, 20);
|
||||
// elm_layout_icon_set(ly, bt);
|
||||
|
@ -33,7 +33,7 @@ icon_container = ly.part('elm.swallow.icon').cast('Efl.Container');
|
|||
icon_container.setContent(bt);
|
||||
ly.emitSignal('elm,state,icon,visible', 'elm');
|
||||
|
||||
bt = new Elm.Icon(ly);
|
||||
bt = new efl.Efl.Ui.Image(ly);
|
||||
bt.setIcon('close');
|
||||
bt.setHintMin(20, 20);
|
||||
// elm_layout_end_set(ly, bt);
|
||||
|
|
|
@ -5,7 +5,7 @@ win.setText("Menu");
|
|||
win.setAutohide(true);
|
||||
|
||||
rect = new efl.Efl.Canvas.Rectangle(win);
|
||||
win.pack(rect);
|
||||
win.setContent(rect);
|
||||
rect.setHintMin( 0, 0);
|
||||
rect.setColor( 0, 0, 0, 0);
|
||||
rect.setVisible(true);
|
||||
|
|
|
@ -12,14 +12,14 @@ win.setAutohide(true);
|
|||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
win.pack(bx);
|
||||
win.setContent(bx);
|
||||
bx.setVisible(true);
|
||||
|
||||
radio_g = new efl.Elm.Radio(win);
|
||||
radio_g.setText("elm.text", "Radio 1");
|
||||
radio_g.setStateValue(1);
|
||||
radio_g.setValue(1);
|
||||
ic = new efl.Elm.Icon(win);
|
||||
ic = new efl.Efl.Ui.Image(win);
|
||||
ic.setIcon("home");
|
||||
radio_g.part("icon").cast("Efl.Container").setContent(ic);
|
||||
bx.packEnd(radio_g);
|
||||
|
@ -32,7 +32,7 @@ radio = new efl.Elm.Radio(win);
|
|||
radio.setText("elm.text", "Radio 2");
|
||||
radio.setStateValue(2);
|
||||
radio.addGroup(radio_g);
|
||||
ic = new efl.Elm.Icon(win);
|
||||
ic = new efl.Efl.Ui.Image(win);
|
||||
ic.setIcon("file");
|
||||
radio.part("icon").cast("Efl.Container").setContent(ic);
|
||||
bx.packEnd(radio);
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
|
||||
efl = require('efl');
|
||||
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Separator");
|
||||
win.setAutohide(true);
|
||||
|
||||
bg = new efl.Elm.Bg(win);
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.setSize(640, 480);
|
||||
win.pack(bg);
|
||||
bg.setVisible(true);
|
||||
|
||||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
win.pack(bx);
|
||||
bx.setVisible(true);
|
||||
|
||||
rect = new efl.Efl.Canvas.Rectangle(win);
|
||||
rect.setColor( 0, 255, 0, 255)
|
||||
rect.setHintMin( 90, 200);
|
||||
rect.setHintWeight(1.0, 1.0);
|
||||
rect.setHintAlign(-1.0, -1.0);
|
||||
rect.setVisible(true);
|
||||
bx.packEnd(rect);
|
||||
|
||||
separator = new efl.Elm.Separator(win);
|
||||
separator.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
|
||||
separator.setVisible(true);
|
||||
bx.packEnd(separator);
|
||||
|
||||
rect2 = new efl.Efl.Canvas.Rectangle(win);
|
||||
rect2.setColor( 0, 0, 255, 255);
|
||||
rect2.setHintMin( 90, 200);
|
||||
rect2.setHintWeight(1.0, 1.0);
|
||||
rect2.setHintAlign(-1.0, -1.0);
|
||||
rect2.setVisible(true);
|
||||
bx.packEnd(rect2);
|
||||
|
||||
win.setVisible(true);
|
|
@ -8,7 +8,7 @@ win.setAutohide(true);
|
|||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
win.pack(bx);
|
||||
win.setContent(bx);
|
||||
bx.setVisible(true);
|
||||
|
||||
sl = new efl.Elm.Slider(win);
|
||||
|
@ -21,12 +21,12 @@ sl.setVisible(true);
|
|||
sl = new efl.Elm.Slider(win);
|
||||
sl.setText("elm.text", "Counter");
|
||||
|
||||
ic = new efl.Elm.Icon(win);
|
||||
ic = new efl.Efl.Ui.Image(win);
|
||||
ic.setIcon("home");
|
||||
// ic.setResizable(false, false);
|
||||
sl.part("icon").cast("Efl.Container").setContent(ic);
|
||||
|
||||
ic = new efl.Elm.Icon(win);
|
||||
ic = new efl.Efl.Ui.Image(win);
|
||||
ic.setIcon("folder");
|
||||
// ic.setResizable(false, false);
|
||||
sl.part("end").cast("Efl.Container").setContent(ic);
|
||||
|
|
|
@ -7,7 +7,7 @@ win.setAutohide(true);
|
|||
|
||||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
win.pack(bx);
|
||||
win.setContent(bx);
|
||||
bx.setVisible(true);
|
||||
|
||||
sp = new efl.Elm.Spinner(win);
|
||||
|
|
|
@ -25,7 +25,7 @@ win = new efl.Efl.Ui.Win.Standard(null);
|
|||
win.setText("Thumb example.");
|
||||
win.setAutohide(true);
|
||||
|
||||
thumb = new efl.Elm.Thumb(win);
|
||||
thumb = new efl.Efl.Ui.Image(win);
|
||||
|
||||
thumb.on('generate,start', _generation_started_cb);
|
||||
thumb.on('generate,stop', _generation_finished_cb);
|
||||
|
@ -34,14 +34,14 @@ thumb.on('generate,error', _generation_error_cb);
|
|||
thumb.setSize(160, 160);
|
||||
// legacy
|
||||
// thumb.setEditable(false);
|
||||
filename = path.join(__dirname, "../../../data/images/plant_01.jpg");
|
||||
filename = path.join(__dirname, "../../../data/elementary/images/plant_01.jpg");
|
||||
filename = process.argv[2] || filename;
|
||||
thumb.setFile(filename, null);
|
||||
// legacy
|
||||
// thumb.reload();
|
||||
|
||||
thumb.setHintWeight(1.0, 1.0);
|
||||
win.pack(thumb);
|
||||
win.setContent(thumb);
|
||||
|
||||
thumb.setVisible(true);
|
||||
win.setSize(320, 320);
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
|
||||
efl = require('efl');
|
||||
|
||||
// Standard node modules
|
||||
util = require('util');
|
||||
path = require('path');
|
||||
fs = require('fs');
|
||||
|
||||
user_acount = 'EnlightenmentKo'
|
||||
// External modules, use 'npm install request twitter'
|
||||
request = require('request');
|
||||
Twitter = require('twitter');
|
||||
|
||||
request = require('request'); //need "npm install request"
|
||||
Twitter = require('twitter'); //need "npm install twitter"
|
||||
user_acount = 'EnlightenmentKo'
|
||||
|
||||
var twit = new Twitter({
|
||||
consumer_key: 'ZbSM93w5Sp2cyZ2SG0XuCvoHV',
|
||||
|
@ -18,12 +20,12 @@ var twit = new Twitter({
|
|||
});
|
||||
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.title = "Twitter App";
|
||||
win.autohide = true;
|
||||
win.setText("Twitter App");
|
||||
win.setAutohide(true);
|
||||
|
||||
box = new efl.Efl.Ui.Box(win);
|
||||
box.setHintWeight(1.0, 1.0);
|
||||
win.pack(box);
|
||||
win.setContent(box);
|
||||
box.setVisible(true);
|
||||
|
||||
tweet_box = new efl.Efl.Ui.Box(win);
|
||||
|
@ -31,58 +33,62 @@ tweet_box.setHintWeight(1.0, 1.0);
|
|||
tweet_box.setHintAlign(-1.0, -1.0);
|
||||
tweet_box.setPackPadding(0.0, 30.0, true);
|
||||
box.packEnd(tweet_box);
|
||||
|
||||
tweet_box_orient = tweet_box.cast("Efl.Orientation");
|
||||
tweet_box_orient.setOrientation(efl.Efl.Orient.VERTICAL);
|
||||
|
||||
|
||||
icon_array = new Array();
|
||||
|
||||
twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, function(error, tweets, response) {
|
||||
if (!error){
|
||||
file = fs.createWriteStream('/tmp/twitter_pic.jpg');
|
||||
file.on('finish', function() {
|
||||
console.log("finished");
|
||||
for (i=0; i < icon_array.length; i++) {
|
||||
console.log(i);
|
||||
icon_array[i].setFile("/tmp/twitter_pic.jpg", null);
|
||||
}
|
||||
});
|
||||
if (tweets.length > 0) {
|
||||
request(tweets[0].user.profile_image_url).pipe(file);
|
||||
}
|
||||
if (error)
|
||||
return;
|
||||
|
||||
for(i=0; i < tweets.length; i++){
|
||||
var layout = new efl.Elm.Layout(win);
|
||||
var filename = path.join(__dirname, 'twitter_example_01.edj');
|
||||
layout.setFile(filename, "tweet");
|
||||
for(i=0; i < tweets.length; i++){
|
||||
var user_name = tweets[i].user.name;
|
||||
var screen_name = tweets[i].user.screen_name;
|
||||
var text = tweets[i].text;
|
||||
|
||||
var user_name = tweets[i].user.name;
|
||||
var screen_name = tweets[i].user.screen_name;
|
||||
var user_icon_url = tweets[i].user.profile_image_url;
|
||||
var text = tweets[i].text;
|
||||
var layout = new efl.Elm.Layout(win);
|
||||
var filename = path.join(__dirname, 'twitter_example_01.edj');
|
||||
layout.setFile(filename, "tweet");
|
||||
|
||||
layout.setText("user_name", screen_name);
|
||||
layout.setText("screen_name", " - @"+screen_name);
|
||||
var entry = new efl.Elm.Entry(win);
|
||||
entry.setText("elm.text", text);
|
||||
console.log(text);
|
||||
part = layout.part("tweet_text").cast("Efl.Container");
|
||||
part.setContent(entry);
|
||||
layout.setText("user_name", screen_name);
|
||||
layout.setText("screen_name", " - @"+screen_name);
|
||||
|
||||
layout.setHintMin(127, 96);
|
||||
layout.setHintWeight(1.0, 1.0);
|
||||
layout.setHintAlign(-1.0, -1.0);
|
||||
var entry = new efl.Elm.Entry(win);
|
||||
entry.setText("elm.text", text);
|
||||
entry.setEditable(false);
|
||||
part = layout.part("tweet_text").cast("Efl.Container");
|
||||
part.setContent(entry);
|
||||
|
||||
var icon = new efl.Efl.Ui.Image(win);
|
||||
icon.fillInside = true;
|
||||
icon_array.push(icon);
|
||||
user_icon = layout.part("user_icon").cast("Efl.Container");
|
||||
user_icon.setContent(icon);
|
||||
item = tweet_box.packEnd(layout);
|
||||
layout.setVisible(true);
|
||||
}
|
||||
tweet_box.setVisible(true);
|
||||
layout.setHintMin(127, 96);
|
||||
layout.setHintWeight(1.0, 1.0);
|
||||
layout.setHintAlign(-1.0, -1.0);
|
||||
|
||||
var icon = new efl.Efl.Ui.Image(win);
|
||||
icon.fillInside = true;
|
||||
icon_array.push(icon);
|
||||
user_icon = layout.part("user_icon").cast("Efl.Container");
|
||||
user_icon.setContent(icon);
|
||||
item = tweet_box.packEnd(layout);
|
||||
layout.setVisible(true);
|
||||
}
|
||||
|
||||
var icon_filename = '/tmp/twitter_pic.jpg';
|
||||
var file = fs.createWriteStream(icon_filename);
|
||||
file.on('finish', function() {
|
||||
console.log("finished loading the icon file.");
|
||||
for (i=0; i < icon_array.length; i++) {
|
||||
icon_array[i].setFile(icon_filename, null);
|
||||
}
|
||||
});
|
||||
|
||||
// Load the tweet icons
|
||||
if (tweets.length > 0) {
|
||||
request(tweets[0].user.profile_image_url).pipe(file);
|
||||
}
|
||||
|
||||
tweet_box.setVisible(true);
|
||||
});
|
||||
|
||||
win.setSize(380, 400);
|
||||
|
|
Loading…
Reference in New Issue