Claus1 / unigui

Universal GUI Framework and Protocol (Python)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

why my text not change . when textfield is updated

bobwatcherx opened this issue · comments

why my txt2 not change this

mycode

from unigui import *

txt2 = Text('Text about dog')

def gantinama(_,value):
	print(value)
	txt2.value = value

eblock = Block('test',                        
        [
        Edit("ganti nama","",changed=gantinama),
        ]
        )

config_area = [eblock,txt2]

a handler has to return the changed object. so in your case it is

return txt2

config_area is not connected to 'blocks' variable of screen.
all gui objects has to be in blocks. In you case instead config_area write

blocks = [eblock] 

or the same

config_area = [eblock]  
blocks =  config_area 

eblock has to include txt2. or another block has.

So always logic structure is Screen -> blocks -> gui objects.