Skip to content

Commit bcbeb32

Browse files
parent fix
1 parent 91ce95c commit bcbeb32

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/core/toga/style/applicator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def __init__(self, widget):
77
def set_bounds(self):
88
# print("LAYOUT", self.widget, self.widget.layout)
99
self.widget._impl.set_bounds(
10-
self.widget.layout.absolute_content_left, self.widget.layout.absolute_content_top,
10+
self.widget.layout.content_left, self.widget.layout.content_top,
1111
self.widget.layout.content_width, self.widget.layout.content_height
1212
)
1313
for child in self.widget.children:

src/winforms/toga_winforms/widgets/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def container(self, container):
2929
self.native.BringToFront()
3030

3131
for child in self.interface.children:
32-
child._impl.container = container
32+
child._impl.container = self
3333

3434
self.rehint()
3535

src/winforms/toga_winforms/window.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,16 @@ def set_content(self, widget):
9090
self.native.Controls.Add(self.toolbar_native)
9191
# Create the lookup table of menu items,
9292
# then force the creation of the menus.
93-
self.native.Controls.Add(widget.native)
9493

9594
# Set the widget's viewport to be based on the window's content.
9695
widget.viewport = WinFormsViewport(native=self.native, frame=self)
9796
widget.frame = self
9897

99-
# Add all children to the content widget.
100-
for child in widget.interface.children:
101-
child._impl.container = widget
98+
# Setting widget's container or parent
99+
widget.container = self
100+
101+
# Expanding the widget to occupy empty space of window
102+
widget.native.Dock = WinForms.DockStyle.Fill
102103

103104
def set_title(self, title):
104105
self.native.Text = title

0 commit comments

Comments
 (0)