Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Rewrite system cursor #5330

Merged
merged 1 commit into from
Aug 15, 2017
Merged

Docs: Rewrite system cursor #5330

merged 1 commit into from
Aug 15, 2017

Conversation

KeyWeeUsr
Copy link
Contributor

@KeyWeeUsr KeyWeeUsr commented Aug 14, 2017

Add more info about fallbacks to other cursors according to the used SDL2 files on specific platforms + a note about only being available on desktops. For more info see files at:

https://hg.libsdl.org/SDL/file/<hash>/src/video/<provider>/<mouse .c/.m/.cpp file>

Feel free to comment about specific changes. If the cursor is different as stated in the docs, comment with a screenshot included. You can run this example:

from kivy.clock import Clock
from kivy.lang import Builder
from kivy.app import runTouchApp
from kivy.uix.button import Button
from kivy.core.window import Window as win
from kivy.uix.gridlayout import GridLayout


class Root(GridLayout):
    def __init__(self, **kwargs):
        super(Root, self).__init__(**kwargs)
        cursors = (
            'arrow', 'ibeam', 'wait', 'crosshair', 'wait_arrow',
            'size_nwse', 'size_nesw', 'size_we', 'size_ns',
            'size_all', 'no', 'hand'
        )

        for i in cursors:
            button = Button(text=i)
            button.bind(on_release=lambda ins: self.reset(ins.text))
            self.add_widget(button)

    def reset(self, cursor):
        win.set_system_cursor(cursor)
        Clock.schedule_once(
            lambda *dt: win.set_system_cursor('arrow'), 1.0
        )


runTouchApp(Root(cols=4))

@KeyWeeUsr KeyWeeUsr merged commit 79aa5d6 into kivy:master Aug 15, 2017
@KeyWeeUsr KeyWeeUsr deleted the docs_cursor branch August 15, 2017 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant