Can't embed boxes inside of other boxes #374
-
|
I'm having difficulties embedding boxes inside other boxes. The window renders fine at first, but crashes the moment an update happens. super().__init__(
vertical=True, # <---- Vertical
spacing=10,
child=self.milestone_box.bind("value", lambda value: [ # <---- I want these to be non-vertical
widgets.CenterBox(
start_widget=self.prev_button,
center_widget=widgets.Label(label=self.data.name),
end_widget=self.next_button
),
value,
]
)
)
# Update functions
def view_prev(self, button_obj):
if self.cursor_ > 0:
self.cursor_ -= 1
self.milestone_box.value = self.milestone_boxes[self.cursor_] # <---- .value attributes are updated
def view_next(self, button_obj):
if self.cursor_ < (len(self.milestone_boxes) - 1):
self.cursor_ += 1
self.milestone_box.value = self.milestone_boxes[self.cursor_] # <---- .value attributes are updatedI keep getting this error, whatever I do. Got error from Again, the layout is fine at first, the update causes this problem. I first thought that we're not able to nest boxes inside each other, that it's how gtk was implemented, but then saw there were many layers of boxes nested in example configurations. There must be something I'm doing wrong. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
|
Beta Was this translation helpful? Give feedback.
Try this: