Support to add empty widget to HContainer and VContainer

The standard container supports adding None as widget so its derivatives
should also.

issue7508
review48481002
This commit is contained in:
Cédric Krier committed 2018-06-11 23:19:23 +02:00
1 parent cab61b5e8f
commit e698eb0cae
1 file changed
+4
+4
View File
@@ -135,6 +135,8 @@ class VContainer(Container):
pass
def add(self, widget, attributes):
if not widget:
return
expand = bool(int(attributes.get('yexpand', False)))
fill = bool(int(attributes.get('yfill', False)))
self.table.pack_start(widget, expand=expand, fill=fill, padding=2)
@@ -153,6 +155,8 @@ class HContainer(Container):
pass
def add(self, widget, attributes):
if not widget:
return
expand = bool(int(attributes.get('xexpand', True)))
fill = bool(int(attributes.get('xfill', True)))
self.table.pack_start(widget, expand=expand, fill=fill, padding=1)