How to use the elm.Entry function in elm

To help you get started, we’ve selected a few elm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shr-project / enlightenment / PROTO / elev8 / data / javascript / notify.js View on Github external
#!/usr/bin/env elev8

var elm = require('elm');

var EXPAND_BOTH = { x: 1.0, y: 1.0 };
var FILL_BOTH = { x: -1.0, y: -1.0 };

var entry_text = "This is an entry widget in this window.";

var entry = elm.Entry({
    text: entry_text,
    weight: EXPAND_BOTH,
    align: FILL_BOTH,
    line_wrap: 3,
    single_line: 1,
    editable: true
});

var win = elm.realise(elm.Window({
    title: "Notify Example",
    width: 320,
    height: 480,
    weight: EXPAND_BOTH,
    align: FILL_BOTH,
    elements: {
        background: elm.Background({
github kakaroto / e17 / PROTO / elev8 / data / javascript / notepad.js View on Github external
width : 320,
    height : 480,
    weight : EXPAND_BOTH,
    align : FILL_BOTH,
    elements : {
        the_background : elm.Background ({
            weight : EXPAND_BOTH,
            align : FILL_BOTH,
            resize : true,
        }),
        the_box1 : elm.Box ({
            weight : EXPAND_BOTH,
            align : FILL_BOTH,
            resize : true,
            elements : {
                the_entry : elm.Entry ({
                    text : entry_text,
                    weight : EXPAND_BOTH,
                    align : FILL_BOTH,
                    line_wrap : 3,
                    editable : true,
                }),
                icon_no_scale : elm.Button ({
                    label : "Clear",
                    weight : { x : -1.0, y : -1.0 },
                    on_click : function(arg) {
                        my_window.elements.the_box1.elements.the_entry.text = "";
                    }
                }),
            },
        }),
    },
github kakaroto / e17 / PROTO / elev8 / data / javascript / calculator.js View on Github external
});
}

op_button.prototype = new any_button;

var calc = elm.realise(elm.Window({
    title : "Calculator demo",
    elements : {
        the_background : elm.Background ({
            weight : EXPAND_BOTH,
            resize : true,
        }),
        vbox : elm.Box ({
            resize : true,
            elements : {
                entry : elm.Entry ({
                    label : "0",
                    align : { x : -1, y : 0 },
                }),
                hbox1 : elm.Box ({
                    horizontal : true,
                    homogeneous : true,
                    elements : {
                        b7 : number_button("7"),
                        b8 : number_button("8"),
                        b9 : number_button("9"),
                        divide : op_button("/", divide),
                    },
                }),
                hbox2 : elm.Box ({
                    horizontal : true,
                    homogeneous : true,
github kakaroto / e17 / PROTO / elev8 / data / javascript / entry.js View on Github external
width: 320,
    height: 480,
    weight: EXPAND_BOTH,
    align: FILL_BOTH,
    elements: {
        the_background: elm.Background({
            weight: EXPAND_BOTH,
            align: FILL_BOTH,
            resize: true
        }),
        the_box: elm.Box({
            weight: EXPAND_BOTH,
            align: FILL_BOTH,
            resize: true,
            elements: {
                the_entry: elm.Entry({
                    text: entry_text,
                    weight: EXPAND_BOTH,
                    align: FILL_BOTH,
                    line_wrap: 3,
                    single_line: 1,
                    editable: true,
                    on_change: function() {
                        print("changed");
                    }
                }),
                the_pass: elm.Entry({
                    text: "Password",
                    weight: EXPAND_BOTH,
                    editable: false,
                    password: true,
                }),
github kakaroto / e17 / PROTO / elev8 / data / javascript / storage.js View on Github external
align: FILL_BOTH,
            resize: true,
        }),
        box: elm.Box({
            weight: EXPAND_BOTH,
            align: FILL_BOTH,
            resize: true,
            elements: {
                first_name : elm.Entry ({
                    text : "First Name",
                    weight : EXPAND_BOTH,
                    align : FILL_BOTH,
                    line_wrap : 3,
                    editable : true,
                }),
                last_name : elm.Entry ({
                    text : "Last Name",
                    weight : EXPAND_BOTH,
                    align : FILL_BOTH,
                    line_wrap : 3,
                    editable : true,
                }),
                phone_number : elm.Entry ({
                    text : "Phone Number",
                    weight : EXPAND_BOTH,
                    align : FILL_BOTH,
                    line_wrap : 3,
                    editable : true,
                }),
                but_box: elm.Box({
                    horizontal: true,
                    elements: {
github kakaroto / e17 / PROTO / elev8 / data / javascript / storage.js View on Github external
elements: {
                first_name : elm.Entry ({
                    text : "First Name",
                    weight : EXPAND_BOTH,
                    align : FILL_BOTH,
                    line_wrap : 3,
                    editable : true,
                }),
                last_name : elm.Entry ({
                    text : "Last Name",
                    weight : EXPAND_BOTH,
                    align : FILL_BOTH,
                    line_wrap : 3,
                    editable : true,
                }),
                phone_number : elm.Entry ({
                    text : "Phone Number",
                    weight : EXPAND_BOTH,
                    align : FILL_BOTH,
                    line_wrap : 3,
                    editable : true,
                }),
                but_box: elm.Box({
                    horizontal: true,
                    elements: {
                        save: elm.Button({
                            label: "Save ",
                            weight: EXPAND_BOTH,
                            on_click: function() { saveItems(); }
                        }),
                        load: elm.Button({
                            label: "Load",
github kakaroto / e17 / PROTO / elev8 / data / javascript / entry.js View on Github external
weight: EXPAND_BOTH,
            align: FILL_BOTH,
            resize: true,
            elements: {
                the_entry: elm.Entry({
                    text: entry_text,
                    weight: EXPAND_BOTH,
                    align: FILL_BOTH,
                    line_wrap: 3,
                    single_line: 1,
                    editable: true,
                    on_change: function() {
                        print("changed");
                    }
                }),
                the_pass: elm.Entry({
                    text: "Password",
                    weight: EXPAND_BOTH,
                    editable: false,
                    password: true,
                }),
                icon_no_scale: elm.Button({
                    label: "Icon no scale",
                    weight: { x: -1.0, y: -1.0 },
                })
            }
        })
    }
});

var e = elm.realise(w);
github shr-project / enlightenment / PROTO / elev8 / data / javascript / browser.js View on Github external
window.elements.vbox.elements.webpage.elements.web.reload();
                  }
                },
                'page-is-loading': {
                  icon: 'process-stop',
                  label: 'Stop',
                  on_select: function() {
                    window.elements.vbox.elements.webpage.elements.web.stop();
                  }
                }
              },
              priority: 200
            },
            { separator: true },
            {
              element: elm.Entry({
                align: FILL_BOTH,
                weight: EXPAND_BOTH,
                single_line: true,
                scrollable: true,
                hint_min: {width: 250, height: 30},
                on_activate: function(text) {
                  window.elements.vbox.elements.webpage.elements.web.uri = text;
                }
              }),
              priority: 400
            },
            { separator: true },
            {
              icon: 'go-home',
              label: 'Home',
              priority: 50,
github kakaroto / e17 / PROTO / elev8 / data / javascript / storage.js View on Github external
var win = elm.realise(elm.Window({
    title : "Storage",
    width : 320,
    height : 530,
    elements : {
        background: elm.Background({
            weight: EXPAND_BOTH,
            align: FILL_BOTH,
            resize: true,
        }),
        box: elm.Box({
            weight: EXPAND_BOTH,
            align: FILL_BOTH,
            resize: true,
            elements: {
                first_name : elm.Entry ({
                    text : "First Name",
                    weight : EXPAND_BOTH,
                    align : FILL_BOTH,
                    line_wrap : 3,
                    editable : true,
                }),
                last_name : elm.Entry ({
                    text : "Last Name",
                    weight : EXPAND_BOTH,
                    align : FILL_BOTH,
                    line_wrap : 3,
                    editable : true,
                }),
                phone_number : elm.Entry ({
                    text : "Phone Number",
                    weight : EXPAND_BOTH,
github kakaroto / e17 / PROTO / elev8 / data / javascript / conform.js View on Github external
weight : EXPAND_BOTH,
                align : FILL_BOTH,
                resize : true,
                elements : {
                    the_entry : elm.Entry ({
                        text : entry_text,
                        weight : {x:-1.0, y:0.0},
                        align : FILL_BOTH,
                        line_wrap : 3,
                        editable : true,
                    }),
                    icon_no_scale : elm.Button ({
                        label : "Icon no scale",
                        weight : { x : -1.0, y : -1.0 },
                    }),
                    the_pass : elm.Entry ({
                        text : "Password",
                        weight : {x:-1.0, y:0.0},
                        editable : false,
                        password : true,
                    }),
                },
            }),
        }),
    },
}));