【发布时间】:2019-03-24 05:03:30
【问题描述】:
当尝试将小部件(问题中的布局)添加到我修改为布局的个性化 ID 时,它会向我启动一个错误,我认为我无法识别个性化 ID
gr_ly = GridLayout(id=i[1], rows=1)
self.LayoutGeneralCI.ids.realll.add_widget(gr_ly)
#Adding another widget to the custom id layout but just always puts me the widgets into the last layout executed
gr_ly.add_widget(self.DatosLayoutCI)
所有代码都在这里
def selection_data_secciones(self):
self.mainwid.dataBase = sqlite3.connect("UserData")
self.mainwid.dataCursor = self.mainwid.dataBase.cursor()
self.mainwid.dataCursor.execute("SELECT * FROM SECCIONES")
fetch = self.mainwid.dataCursor.fetchall()
for i in fetch:
self.LayoutGeneralCI = LayoutGeneralCI(self.mainwid)
ref_idd = i[1]
gr_ly = GridLayout(id=i[1], rows=1)
print(type(gr_ly.id))
self.LayoutGeneralCI.ids.realll.add_widget(gr_ly)
print(self.LayoutGeneralCI.ids)
self.LayoutGeneralCI.ids.title_sect_lbl.text = i[1]
self.ids.container_ci.add_widget(self.LayoutGeneralCI)
for produ in self.mainwid.dataCursor.execute("SELECT * FROM MATERIALES"):
self.DatosLayoutCI = DatosLayoutCI(self.mainwid)
txtvar_ci = "Nombre: [b]{}[/b] \n".format(produ[1])
txtvar2_ci = "Proveedor: [b]{}[/b] \n".format(produ[3])
if produ[8] <= str(0):
txtvar3_ci = "Disponibilidad: [color=#FF0000][b]Agotado[/b][/color]"
else:
txtvar3_ci = "Disponibilidad: [color=#00FF00][b]Disponible[/b][/color]"
txtvargeneral_ci = txtvar_ci + txtvar2_ci + txtvar3_ci
self.DatosLayoutCI.ids.content_cill.text = txtvargeneral_ci
var_sectttion = self.mainwid.AgregarProductos.ids.section_product.text#
var_reference_id = produ[2]
gr_ly.add_widget(self.DatosLayoutCI)
self.mainwid.dataBase.commit() #DISCOMMENT NECCESARY
self.mainwid.dataBase.close()
结果是:
self.LayoutGeneralCI.ids.var.add_widget(self.DatosLayoutCI)
File "kivy\properties.pyx", line 841, in kivy.properties.ObservableDict.__getattr__
AttributeError: 'super' object has no attribute '__getattr__'
【问题讨论】:
-
你必须在这个问题中添加更多代码,其他问题将来会自动排除,所以未来的读者不会理解你的问题,想法是你的问题不仅会为你服务,而且现在和未来的社区