python-efl: Improve documentation for Actionslider and Background, check
return value in Bg.file. SVN revision: 84308
This commit is contained in:
parent
50d35b8519
commit
8573629c83
|
@ -18,6 +18,8 @@
|
|||
|
||||
"""
|
||||
|
||||
.. _Elm_Actionslider_Pos:
|
||||
|
||||
.. rubric:: Actionslider positions
|
||||
|
||||
.. data:: ELM_ACTIONSLIDER_NONE
|
||||
|
@ -77,12 +79,12 @@ cdef class Actionslider(LayoutClass):
|
|||
magnetized" position.
|
||||
|
||||
This widget emits the following signals, besides the ones sent from
|
||||
:py:class:`elementary.layout.Layout`:
|
||||
:py:class:`efl.elementary.layout_class.LayoutClass`:
|
||||
|
||||
- **selected** - when user selects an enabled position (the label is
|
||||
passed as event info)".
|
||||
passed as event info)".
|
||||
- **pos_changed** - when the indicator reaches any of the
|
||||
positions("left", "right" or "center").
|
||||
positions("left", "right" or "center").
|
||||
|
||||
Default text parts of the actionslider widget that you can use for are:
|
||||
|
||||
|
@ -91,8 +93,6 @@ cdef class Actionslider(LayoutClass):
|
|||
- **right** - A right label of the actionslider
|
||||
- **center** - A center label of the actionslider
|
||||
|
||||
.. note:: By default all positions are set as enabled.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
|
@ -113,7 +113,7 @@ cdef class Actionslider(LayoutClass):
|
|||
property indicator_pos:
|
||||
"""Indicator position.
|
||||
|
||||
:type: Elm_Actionslider_Pos
|
||||
:type: :ref:`Actionslider position <Elm_Actionslider_Pos>`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
|
@ -131,7 +131,7 @@ cdef class Actionslider(LayoutClass):
|
|||
magnets ``or`` them together(e.g.: ``ELM_ACTIONSLIDER_LEFT |
|
||||
ELM_ACTIONSLIDER_RIGHT``)
|
||||
|
||||
:type: Elm_Actionslider_Pos
|
||||
:type: :ref:`Actionslider position <Elm_Actionslider_Pos>`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
|
@ -149,9 +149,9 @@ cdef class Actionslider(LayoutClass):
|
|||
enabled ``or`` them together(e.g.: ``ELM_ACTIONSLIDER_LEFT |
|
||||
ELM_ACTIONSLIDER_RIGHT``).
|
||||
|
||||
.. note:: All the positions are enabled by default.
|
||||
.. note:: All positions are enabled by default.
|
||||
|
||||
:type: Elm_Actionslider_Pos
|
||||
:type: :ref:`Actionslider position <Elm_Actionslider_Pos>`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
|
||||
"""
|
||||
|
||||
.. rubric:: Background tiling modes
|
||||
.. _Elm_Bg_Option:
|
||||
|
||||
.. rubric:: Background display modes
|
||||
|
||||
.. data:: ELM_BG_OPTION_CENTER
|
||||
|
||||
|
@ -89,38 +91,33 @@ cdef class Background(LayoutClass):
|
|||
|
||||
.. note:: This will only affect the contents of one of the background's
|
||||
swallow spots, namely *"elm.swallow.background"*. If you want to
|
||||
achieve the :py:class:`elementary.layout.Layout`'s file setting
|
||||
achieve the :py:class:`efl.elementary.layout_class.LayoutClass`'s file setting
|
||||
behavior, you'll have to call that method on this object.
|
||||
|
||||
:type: string file, optional string group
|
||||
:type: string file, *optional* string group
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef const_char *filename, *group
|
||||
elm_bg_file_get(self.obj, &filename, &group)
|
||||
if filename == NULL:
|
||||
filename = ""
|
||||
if group == NULL:
|
||||
group = ""
|
||||
return (_ctouni(filename), _ctouni(group))
|
||||
|
||||
def __set__(self, value):
|
||||
cdef int ret
|
||||
if isinstance(value, tuple) or isinstance(value, list):
|
||||
filename, group = value
|
||||
else:
|
||||
filename = value
|
||||
group = ""
|
||||
elm_bg_file_set(self.obj, _cfruni(filename), _cfruni(group))
|
||||
ret = elm_bg_file_set(self.obj, _cfruni(filename), _cfruni(group))
|
||||
if not ret:
|
||||
raise RuntimeError("Could not set background file.")
|
||||
|
||||
def file_set(self, filename, group = ""):
|
||||
return bool(elm_bg_file_set(self.obj, _cfruni(filename), _cfruni(group)))
|
||||
def file_get(self):
|
||||
cdef const_char *filename, *group
|
||||
elm_bg_file_get(self.obj, &filename, &group)
|
||||
if filename == NULL:
|
||||
filename = ""
|
||||
if group == NULL:
|
||||
group = ""
|
||||
return (_ctouni(filename), _ctouni(group))
|
||||
|
||||
property option:
|
||||
|
@ -131,7 +128,7 @@ cdef class Background(LayoutClass):
|
|||
image file. The image can be displayed tiled, scaled, centered or
|
||||
stretched.
|
||||
|
||||
:type: Elm_Bg_Option
|
||||
:type: :ref:`Background display mode <Elm_Bg_Option>`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
|
|
Loading…
Reference in New Issue