You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On macOS, if the content of the window is a toga.Box(), and the window is made full screen (full app-level presentation mode, not window-level full-screen), the window content is not visible.
If main_window.content is a toga.Box:
"""My first application"""importtogaclassHelloWorld(toga.App):
defhandle_press(self,widget,**kwargs):
self.set_full_screen(self.main_window)
self.main_window.content.add(toga.Label(text="We are in App Full Screen mode"))
print(f"Subviews After App Full Screen:{self.main_window._impl.native.contentView.subviews}")
defstartup(self):
"""Construct and show the Toga application. Usually, you would add your application to a main content box. We then create a main window (with a name matching the app), and show the main window. """self.main_window=toga.MainWindow(title=self.formal_name)
self.main_window.content=toga.Box(children=[
toga.Button(text="Enter App Full Screen Mode",on_press=self.handle_press),
toga.Label(
text=""" Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"""""" Maecenas vitae felis non est vehicula pulvinar id eu augue.\n"""""" Maecenas et lectus tellus. Sed et lacinia erat, at pharetra quam.\n"""
)
])
self.main_window.show()
print(f"Subviews Before App Full Screen:{self.main_window._impl.native.contentView.subviews}")
defmain():
returnHelloWorld()
After entering app full screen mode:
The children of the toga.Box() are not visible after entering full screen.
However, if the main_window.content is a toga.ScrollContainer then it works correctly:
"""My first application"""importtogaclassHelloWorld(toga.App):
defhandle_press(self,widget,**kwargs):
self.set_full_screen(self.main_window)
self.main_window.content.content.add(toga.Label(text="We are in App Full Screen mode"))
print(f"Subviews After App Full Screen:{self.main_window._impl.native.contentView.subviews}")
defstartup(self):
"""Construct and show the Toga application. Usually, you would add your application to a main content box. We then create a main window (with a name matching the app), and show the main window. """self.main_window=toga.MainWindow(title=self.formal_name)
self.main_window.content=toga.ScrollContainer(content=toga.Box(children=[
toga.Button(text="Enter App Full Screen Mode",on_press=self.handle_press),
toga.Label(
text=""" Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"""""" Maecenas vitae felis non est vehicula pulvinar id eu augue.\n"""""" Maecenas et lectus tellus. Sed et lacinia erat, at pharetra quam.\n"""
)
]))
self.main_window.show()
print(f"Subviews Before App Full Screen:{self.main_window._impl.native.contentView.subviews}")
defmain():
returnHelloWorld()
The children are being added properly as indicated by the subviews, but they are not visible when content is a toga.Box()
The text was updated successfully, but these errors were encountered:
My guess is that the problem will be a layout issue - when going full screen, the "window" is possible reporting as "zero sized" (either temporarily or permanently), resulting in an incorrect layout for window content.
Originally posted by @proneon267 in #2473 (comment)
On macOS, if the content of the window is a toga.Box(), and the window is made full screen (full app-level presentation mode, not window-level full-screen), the window content is not visible.
If
main_window.content
is atoga.Box
:After entering app full screen mode:
The children of the toga.Box() are not visible after entering full screen.
However, if the
main_window.content
is atoga.ScrollContainer
then it works correctly:The children are being added properly as indicated by the subviews, but they are not visible when content is a
toga.Box()
The text was updated successfully, but these errors were encountered: