Table Of Contents

Previous topic

efl.emotion.Emotion Class

Next topic

actionslider Module

efl.elementary Package

Features

Callbacks

Widget callbacks

Widget callbacks are set with callback_*_add methods which take a callable, and optional args, kwargs as data.

The callbacks have a signature of either:

obj, *args, **kwargs

or:

obj, event_info, *args, **kwargs

Event callbacks

Event callbacks have signature of:

object, source_object, event_type, event_info, *args, **kwargs

A sample Python Elementary program

from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
from efl import elementary
from efl.elementary.window import StandardWindow
from efl.elementary.box import Box
from efl.elementary.button import Button
from efl.elementary.panel import Panel, ELM_PANEL_ORIENT_LEFT

EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
EXPAND_VERT = 0.0, EVAS_HINT_EXPAND
FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
FILL_VERT_ALIGN_LEFT = 0.0, EVAS_HINT_FILL

def panel_clicked(obj):
    win = StandardWindow("panel", "Panel test", autodel=True, size=(300, 300))
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    bx = Box(win, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(bx)
    bx.show()

    bt = Button(win, text="HIDE ME :)", size_hint_weight=EXPAND_BOTH,
        size_hint_align=FILL_BOTH)
    bt.show()

    panel = Panel(win, orient=ELM_PANEL_ORIENT_LEFT, content=bt,
        size_hint_weight=EXPAND_VERT, size_hint_align=FILL_VERT_ALIGN_LEFT)

    bx.pack_end(panel)
    panel.show()

    win.show()


if __name__ == "__main__":
    elementary.init()

    panel_clicked(None)

    elementary.run()
    elementary.shutdown()

What is Elementary?

Elementary is a VERY SIMPLE toolkit. It is not meant for writing extensive desktop applications (yet). Small simple ones with simple needs.

It is meant to make the programmers work almost brainless but give them lots of flexibility.

Reference

Package

Everything in the modules general and need is also available at package level.

Modules

Inheritance diagram