no message

master
DESKTOP-4RNDQIC\29019 2021-05-09 22:24:21 +08:00
parent f2a1dbeba7
commit 3a1fc0bbfe
1 changed files with 9 additions and 8 deletions

View File

@ -89,18 +89,21 @@ func RangeWidget(p *Widget ) string{
return ""
}
ret := ""
ret += p.Class + "#" + p.Name + " \r\n{\r\n}\r\n"
parent := ""
tmp := p
for ;tmp != nil;tmp = tmp.Parent{
parent = tmp.Class + " #" + tmp.Name + " " + parent
}
ret += parent + " \r\n{\r\n}\r\n"
if(p.Childs.Len() > 0){
wid := p.Childs.Front()
for ;wid != nil;wid = wid.Next(){
output := ""
tmp := wid.Value.(*Widget)
for ;tmp != nil;tmp = tmp.Parent{
output = tmp.Class + " #" + tmp.Name + " " + output
}
ret += output + "\r\n{\r\n}\r\n"
ret += RangeWidget(tmp)
}
}
// log.Print(ret)
return ret
}
@ -115,7 +118,6 @@ func GetUifrom(path io.Reader) string{
switch startElement := token.(type) {
case xml.StartElement:
if(startElement.Name.Local == "widget"){
// log.Print(startElement.Name.Local)
if(list.Len() == 0){
ins := new(Widget)
ins.Class = getAttr("class",startElement.Attr)
@ -126,7 +128,6 @@ func GetUifrom(path io.Reader) string{
ins := new(Widget)
ins.Class = getAttr("class",startElement.Attr)
ins.Name = getAttr("name",startElement.Attr)
// log.Print(list.Back().Value.(*Widget))
ins.Parent = list.Back().Value.(*Widget)
list.Back().Value.(*Widget).Childs.PushBack(ins)
list.PushBack(ins)