mirror of https://github.com/kivy/kivy.git
commit
c7d425cf91
|
@ -239,7 +239,7 @@ cdef class CyClockBase(object):
|
|||
|
||||
.. versionadded:: 1.0.5
|
||||
|
||||
..versionchanged:: 1.9.2
|
||||
.. versionchanged:: 1.9.2
|
||||
|
||||
``interval`` has been added. If True, it create a event that is called
|
||||
every <timeout> seconds similar to :meth:`schedule_interval`. Defaults to
|
||||
|
@ -301,7 +301,7 @@ cdef class CyClockBase(object):
|
|||
If it's a callable, then the callable will be unscheduled if it
|
||||
was scheduled.
|
||||
|
||||
..warning::
|
||||
.. warning::
|
||||
|
||||
Passing the callback function rather than the returned
|
||||
:class:`ClockEvent` will result in a significantly slower
|
||||
|
|
|
@ -843,6 +843,7 @@ cdef class EventDispatcher(ObjectWithUid):
|
|||
|
||||
|
||||
::
|
||||
|
||||
>>> mywidget = Widget()
|
||||
>>> mywidget.create_property('custom')
|
||||
>>> mywidget.custom = True
|
||||
|
|
|
@ -98,7 +98,7 @@ next frame even if you add a new callback with -1 from a running
|
|||
callback. However, :class:`Clock` has an iteration limit for these
|
||||
callbacks: it defaults to 10.
|
||||
|
||||
If you schedule a callback that schedules a callback that schedules a .. etc
|
||||
If you schedule a callback that schedules a callback that schedules a ... etc
|
||||
more than 10 times, it will leave the loop and send a warning to the console,
|
||||
then continue after the next frame. This is implemented to prevent bugs from
|
||||
hanging or crashing the application.
|
||||
|
@ -156,7 +156,7 @@ Even if x and y changes within one frame, the callback is only run once.
|
|||
:meth:`CyClockBase.create_trigger` has a timeout parameter that
|
||||
behaves exactly like :meth:`CyClockBase.schedule_once`.
|
||||
|
||||
..versionchanged:: 1.9.2
|
||||
.. versionchanged:: 1.9.2
|
||||
|
||||
:meth:`CyClockBase.create_trigger` now has a ``interval`` parameter.
|
||||
If False, the default, it'll create an event similar to
|
||||
|
@ -168,7 +168,7 @@ Unscheduling
|
|||
|
||||
An event scheduled with :meth:`CyClockBase.schedule_once`,
|
||||
:meth:`CyClockBase.schedule_interval`, or with
|
||||
:meth:`CyClockBase.create_trigger`and then triggered can be unscheduled in
|
||||
:meth:`CyClockBase.create_trigger` and then triggered can be unscheduled in
|
||||
multiple ways. E.g::
|
||||
|
||||
def my_callback(dt):
|
||||
|
|
|
@ -285,7 +285,7 @@ class WindowBase(EventDispatcher):
|
|||
The *unicode* parameter has been deprecated in favor of
|
||||
codepoint, and will be removed completely in future versions.
|
||||
|
||||
`on_key_down`: key, scancode, codepoint
|
||||
`on_key_down`: key, scancode, codepoint, modifier
|
||||
Fired when a key pressed.
|
||||
|
||||
.. versionchanged:: 1.3.0
|
||||
|
|
|
@ -74,7 +74,7 @@ Let's say you want to save the angle and pressure of the touch, if available::
|
|||
|
||||
Or with modules variables::
|
||||
|
||||
$ python main.py -m recorder,attrs=is_touch:sx:sy:angle:pressure,\
|
||||
$ python main.py -m recorder,attrs=is_touch:sx:sy:angle:pressure, \
|
||||
profile_mask=pos:angle:pressure
|
||||
|
||||
Known limitations
|
||||
|
|
|
@ -103,7 +103,7 @@ def parse_bool(text):
|
|||
|
||||
|
||||
def parse_string(text):
|
||||
'''Parse a string to a string (removing single and double quotes)'''
|
||||
'''Parse a string to a string (removing single and double quotes).'''
|
||||
if len(text) >= 2 and text[0] in ('"', "'") and text[-1] in ('"', "'"):
|
||||
text = text[1:-1]
|
||||
return text.strip()
|
||||
|
|
|
@ -33,14 +33,14 @@ the text.
|
|||
For example, this label's size will be set to the text content
|
||||
(plus :attr:`~Label.padding`):
|
||||
|
||||
.. code-block:: python
|
||||
.. code-block:: kv
|
||||
|
||||
Label:
|
||||
size: self.texture_size
|
||||
|
||||
This label's text will wrap at the specified width and be clipped to the height:
|
||||
|
||||
.. code-block:: python
|
||||
.. code-block:: kv
|
||||
|
||||
Label:
|
||||
text_size: cm(6), cm(4)
|
||||
|
@ -51,7 +51,7 @@ This label's text will wrap at the specified width and be clipped to the height:
|
|||
Combine these concepts to create a Label that can grow vertically but wraps the
|
||||
text at a certain width:
|
||||
|
||||
.. code-block:: python
|
||||
.. code-block:: kv
|
||||
|
||||
Label:
|
||||
text_size: root.width, None
|
||||
|
@ -74,7 +74,7 @@ which text is aligned. For instance, the following code binds this size to the
|
|||
size of the Label, so text will be aligned within the widget bounds. This
|
||||
will also automatically wrap the text of the Label to remain within this area.
|
||||
|
||||
.. code-block:: python
|
||||
.. code-block:: kv
|
||||
|
||||
Label:
|
||||
text_size: self.size
|
||||
|
@ -177,7 +177,7 @@ and deploy it universally via kv:
|
|||
.. code-block:: kv
|
||||
|
||||
<Label>:
|
||||
-font_name: '/<path>/<to>/<font>'
|
||||
font_name: '/<path>/<to>/<font>'
|
||||
|
||||
Note that this needs to be done before your widgets are loaded as kv rules are
|
||||
only applied at load time.
|
||||
|
|
Loading…
Reference in New Issue