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

iOS App has no attribute 'hide_cursor' #1235

Closed
massenz opened this issue Mar 28, 2021 · 1 comment · Fixed by #2049
Closed

iOS App has no attribute 'hide_cursor' #1235

massenz opened this issue Mar 28, 2021 · 1 comment · Fixed by #2049
Labels
bug A crash or error in behavior. good first issue Is this your first time contributing? This could be a good place to start! iOS The issue relates to Apple iOS mobile support.

Comments

@massenz
Copy link

massenz commented Mar 28, 2021

Describe the bug
Calling the method hide_cursor() on a toga.App causes the app to crash with:

2021-03-28 13:35:22.700314-0700 Find [938:323815] AttributeError: 'App' object has no attribute 'hide_cursor'

To Reproduce
Steps to reproduce the behavior:

  1. Create a simple iOS App
  2. inside the main method of your application class (derived from toga.App) call: self.hide_cursor()
  3. App crashes with stacktrace
  4. See error
 Error in long running handler: 'App' object has no attribute 'hide_cursor'
 Traceback (most recent call last):
   File "/private/var/containers/Bundle/Application/75DCDE12-8E7D-4D0A-97D1-B999813DBD9B/Find.app/Library/Application Support/app_packages/toga/handlers.py", line 13, in long_running_task
     delay = next(generator)
   File "/private/var/containers/Bundle/Application/75DCDE12-8E7D-4D0A-97D1-B999813DBD9B/Find.app/Library/Application Support/app/find/app.py", line 84, in select_distance_task
     self.hide_cursor()
   File "/private/var/containers/Bundle/Application/75DCDE12-8E7D-4D0A-97D1-B999813DBD9B/Find.app/Library/Application Support/app_packages/toga/app.py", line 412, in hide_cursor
     self._impl.hide_cursor()
 AttributeError: 'App' object has no attribute 'hide_cursor'

Expected behavior
The method is documented here

Not sure what to expect, really, (the description, rather tautologically, says "hides cursors") but at the very least not to crash?

What I was really trying to achieve was to hide the keyboard from view (also because the focus() method on non-input fields seems to be a no-op?).

Screenshots
If applicable, add screenshots to help explain your problem.

Environment:

  • Operating System: iOS 14.4
  • Python version: 3.8
  • Software versions:
    toga==0.2.15
    toga-cocoa==0.2.15
    toga-core==0.2.15

Additional context

It would be good to have a way to make the "soft" keyboard disappear in iOS, as it obscures half the screen, and Toga does not appear to have a means to achieve that.

@massenz massenz added the bug A crash or error in behavior. label Mar 28, 2021
@massenz
Copy link
Author

massenz commented Mar 29, 2021

Also, just noticed:

[iOS] Not implemented: Widget.focus()

which pretty much explains why this is not working.

At the moment, I'm really stuck, I'd be curious to know if anyone has ever used Toga for a real-life iOS app?

@freakboy3742 freakboy3742 added bug A crash or error in behavior. up-for-grabs good first issue Is this your first time contributing? This could be a good place to start! iOS The issue relates to Apple iOS mobile support. and removed bug A crash or error in behavior. labels Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. good first issue Is this your first time contributing? This could be a good place to start! iOS The issue relates to Apple iOS mobile support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants