Previous topic

object Module

Next topic

panel Module

object_item Module

class efl.elementary.object_item.ObjectItem

Bases: object

A generic item for the widgets.

data
Type :dict

A dictionary object that holds user data.

content

The default content part of this ObjectItem.

cursor

The cursor that will be displayed when mouse is over the object. The object can have only one cursor set to it, so if this function is called twice for an object, the previous set will be unset.

cursor_engine_only

cursor_engine_only_set(engine_only)

Sets cursor engine only usage for this object.

Note

before you set a style you should define a cursor with cursor

cursor_style

The style for this object cursor.

Note

before you set a style you should define a cursor with cursor

data_get() → tuple

Deprecated since version 1.8: Use the data attribute (dict) instead.

data_set(self, *args **kwargs)

Deprecated since version 1.8: Use the data attribute (dict) instead.

delete()

Delete this ObjectItem.

disabled

The disabled state of an widget item.

Elementary object item can be disabled, in which state they won’t receive input and, in general, will be themed differently from their normal state, usually greyed out. Useful for contexts where you don’t want your users to interact with some of the parts of you interface.

Type :bool
domain_part_text_translatable_set(self, part, domain, bool translatable)

Mark the part text to be translatable or not.

Once you mark the part text to be translatable, the text will be translated internally regardless of part_text_set() and domain_translatable_part_text_set(). In other case, if you set the Elementary policy that all text will be translatable in default, you can set the part text to not be translated by calling this API.

Parameters:
  • part – The part name of the translatable text
  • domain – The translation domain to use
  • translatableTrue, the part text will be translated internally. False, otherwise.
See :

domain_translatable_part_text_set()

See :

part_text_set()

See :

efl.elementary.general.policy_set()

New in version 1.8.

domain_translatable_part_text_set(part = None, domain = None, text = None)

Set the text for an object item’s part, marking it as translatable.

The string to set as text must be the original one. Do not pass the return of gettext() here. Elementary will translate the string internally and set it on the object item using elm_object_item_part_text_set(), also storing the original string so that it can be automatically translated when the language is changed with elm_language_set(). The domain will be stored along to find the translation in the correct catalog. It can be None, in which case it will use whatever domain was set by the application with textdomain(). This is useful in case you are building a library on top of Elementary that will have its own translatable strings, that should not be mixed with those of programs using the library.

Parameters:
  • part – The name of the part to set
  • domain – The translation domain to use
  • text – The original, non-translated text to set

New in version 1.8.

part_content_get(unicode part) → Object

Get a content of an object item

Note

Elementary object items may have many contents

Parameters:part (string) – The content part name to unset (None for the default content)
Returns:content of the object item or None for any error
Return type:Object
part_content_set(unicode part, Object content)

Set a content of an object item

This sets a new object to an item as a content object. If any object was already set as a content object in the same part, previous object will be deleted automatically.

Note

Elementary object items may have many contents

Parameters:
  • part – The content part name to set (None for the default content)
  • content – The new content of the object item
part_content_unset(unicode part)

Unset a content of an object item

Note

Elementary object items may have many contents

Parameters:part (string) – The content part name to unset (None for the default content)
part_text_get()

part_text_set(unicode part) -> unicode text

Gets the text of a given part of this object.

See also

text_get() and part_text_set()

Parameters:part (string) – part name to get the text.
Returns:the text of a part or None if nothing was set.
Return type:string
part_text_set(unicode part, unicode text)

Sets the text of a given part of this object.

See also

text and part_text_get()

Parameters:
  • part (string) – part name to set the text.
  • text (string) – text to set.
signal_emit(unicode emission, unicode source)

Send a signal to the edje object of the widget item.

This function sends a signal to the edje object of the obj item. An edje program can respond to a signal by specifying matching ‘signal’ and ‘source’ fields.

Parameters:
  • emission (string) – The signal’s name.
  • source (string) – The signal’s source.
text

The main text for this object.

Type :string
tooltip_content_cb_set(func, *args, **kargs)

Set the content to be shown in the tooltip object

Setup the tooltip to object. The object can have only one tooltip, so any previews tooltip data is removed. func(owner, tooltip, args, kargs) will be called every time that need show the tooltip and it should return a valid Evas_Object. This object is then managed fully by tooltip system and is deleted when the tooltip is gone.

Parameters:func (function) – Function to be create tooltip content, called when need show tooltip.
tooltip_style

The style for this object tooltip.

Note

before you set a style you should define a tooltip with tooltip_content_cb_set() or tooltip_text_set()

tooltip_text_set(unicode text)

Set the text to be shown in the tooltip object

Setup the text as tooltip object. The object can have only one tooltip, so any previous tooltip data is removed. Internally, this method calls tooltip_content_cb_set()

tooltip_unset()

Unset tooltip from object

Remove tooltip from object. If used the tooltip_text_set() the internal copy of label will be removed correctly. If used tooltip_content_cb_set(), the data will be unreferred but no freed.

translatable_part_text_get(part = None)

Gets the original string set as translatable for an object item.

When setting translated strings, the function elm_object_item_part_text_get() will return the translation returned by gettext(). To get the original string use this function.

Parameters:part – The name of the part that was set
Returns:The original, untranslated string

New in version 1.8.

widget

Get the widget object’s handle which contains a given item

Note

This returns the widget object itself that an item belongs to.

Note

Every elm_object_item supports this API

Type :Object