-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Allowing 'none' Values for a Choice #3
Comments
@mcrowson , could you please list out the detailed reproduce steps? I don't have problem to use |
Sure, will do so in a bit. But None (the Python None type) is not an acceptable value for visibility and display, the string ‘none’ is what it wants.
… On Jul 16, 2018, at 7:51 PM, Stanton ***@***.***> wrote:
@mcrowson <https://github.com/mcrowson> , could you please list out the detailed reproduce steps? I don't have problem to use style=None for my toga GUI.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#3 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AGJ2klOG-gEXFY4k_i4Vft7st9uZfjeMks5uHScBgaJpZM4VRY27>.
|
To reproduce: cookiecutter https://github.com/pybee/briefcase-template
# named the project bug_example
cd bug_example
python3 -m venv env
env/bin/pip install briefcase toga Then I added a Box named import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW
class BugExample(toga.App):
def startup(self):
# Create a main window with a name matching the app
self.main_window = toga.MainWindow(title=self.name)
some_content = toga.Box()
some_content.style.visibility = 'none'
# Create a main content box
main_box = toga.Box()
# Add the content on the main window
self.main_window.content = main_box
# Show the main window
self.main_window.show()
def main():
return BugExample('Bug Example', 'com.example.bug_example') Next I ran setup for ios
I opened the xcode project then in xcode. It builds successfully, The simulator launches and i see the following in the xcode console 2018-07-17 09:27:30.726154-0400 Bug Example[1038:14423] File "/Users/matthew/Library/Developer/CoreSimulator/Devices/90E3F30B-408D-4D8C-81BE-48E2A139543D/data/Containers/Bundle/Application/5597D9C1-561C-4830-92C8-DAA6C2F3D45F/Bug Example.app/Library/Application Support/com.example.bug_example/app/bug_example/app.py", line 13, in startup
2018-07-17 09:27:30.726382-0400 Bug Example[1038:14423] some_content.style.visibility = 'none'
2018-07-17 09:27:30.726500-0400 Bug Example[1038:14423] File "/Users/matthew/Library/Developer/CoreSimulator/Devices/90E3F30B-408D-4D8C-81BE-48E2A139543D/data/Containers/Bundle/Application/5597D9C1-561C-4830-92C8-DAA6C2F3D45F/Bug Example.app/Library/Application Support/com.example.bug_example/app_packages/travertino/declaration.py", line 181, in setter
2018-07-17 09:27:30.726748-0400 Bug Example[1038:14423] value, name, choices
2018-07-17 09:27:30.726944-0400 Bug Example[1038:14423] ValueError: Invalid value 'none' for property 'visibility'; Valid values are: hidden, none, visible
2018-07-17 09:27:30.731067-0400 Bug Example[1038:14423] App became active. |
In Toga, possible choices are given for display and visibility of 'none'
https://github.com/pybee/toga/blob/master/src/core/toga/style/pack.py#L33
Entering a valid entry of 'none' for these however gets converted to the native Python None
https://github.com/pybee/travertino/blob/master/travertino/declaration.py#L51
Which causes a ValueError to be raised.
ValueError: Invalid value 'none' for property 'visibility'; Valid values are: hidden, none, visible
The text was updated successfully, but these errors were encountered: