Answer the question
In order to leave comments, you need to log in
How will Kivy add a new GUI widget?
def build(self):
self.al = AnchorLayout()
self.bl = BoxLayout()
self.bl = BoxLayout(orientation = 'vertical', size_hint = [.4, .4])
self.regis = Button(text = 'Создать',on_press = self.btn_reg, font_size = 14)
# В кнопке прыгаем на btn_reg()
self.bl.add_widget(self.regis)
self.al.add_widget(self.bl)
return self.al
def btn_reg(self, instance):
asd = Label( text='Привет' )
return asd # первая попытка не работает
##--------------------##
return Label( text='Привет' ) # Так тоже не работает
##--------------------##
asd = Label( text='Привет' )
bs = BoxLayout()
bs.add_widget(asd)
return bs
# Тоже не пашет
# Не могу создать новый виджет никакой((
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question