Open BrendanSimon opened 4 years ago
Toga already has an NavigationView widget (which should possibly be called NavigationContainer; this would seem to be the match for the iOS UINavigationBar - a top level widget for navigating panes of content by "depth".
Closing this ticket on the basis there's already a toga.core API for this feature, and tickets aren't an especially effective way of coordinating efforts around specific platform implementations of widgets.
I can't see any mention of NavigationView
(or NavigationContainer
) in the docs.
https://toga.readthedocs.io/en/latest/reference/api/widgets/index.html
https://toga.readthedocs.io/en/latest/reference/api/index.html
https://toga.readthedocs.io/en/latest/reference/api/containers/index.html
Found it in the road map.
https://toga.readthedocs.io/en/latest/background/roadmap.html
I can see in the source code NavigationView
where as the roadmap mentions NavigationContainer
.
Can't see any examples for it, but there does seem to be some tests.
BTW, the test_navigationview.py
has the following code. Is it correct (the reference to "switch" looks suspicious to me)?
def test_widget_created(self):
self.assertEqual(self.switch._impl.interface, self.switch)
self.assertActionPerformed(self.switch, 'create Switch')
Hrm... not sure what has happened there. The git history isn't being helpful, as the change predates the toga 0.3. restructure; I can only assume I stubbed out some code very early on, and because the widget doesn't work and isn't documented, nobody has been back to correct it.
However:
NavigationController
, not NavigationView
.switch
in the test almost certainly betrays the provenance of the code - it's a copy and paste error.Reopening on the basis that a navigation controller is a very important feature, especially for mobile apps, and despite the state of this ticket, we don't have one yet.
On iOS, to have native look and feel, a NavigationBar and NavigationControl needs to be implemented. Common examples are the iOS Settings app and iOS Contacts app.
https://developer.apple.com/documentation/uikit/uinavigationcontroller
https://developer.apple.com/documentation/uikit/uinavigationbar
This needs to be abstracted to a common Toga API. I presume Android has something similar. Windows may have something similar with it's Windows Explorer address bar hierarchy. Not sure about macOS or GTK (or wxPython or PyQt or PySide)