Yardım Python gui children hatâsı

Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

user

Üye
Üye
Mesaj
27
Çözümler
2
Beğeni
1
Puan
53
Ticaret Puanı
0
Method çağırılınca oyundan atıyor; gerekçesi windowsdaki zirh ve diğer childrenleri yok sayıp hatâ veriyor

uinpcekran.py(line:40) __Load_BindObject
ui.py(line:4256) GetChild

OptionDialog.__Load_BindObject - <type 'exceptions.KeyError'>:'zirh'

Kod:
import ui
import net
import app
import chrmgr


class NPCEkran(ui.ScriptWindow):

    def __init__(self):
        ui.ScriptWindow.__init__(self)
        self.__Initialize()
        self.__Load()

    def __del__(self):
        ui.ScriptWindow.__del__(self)
        print " -------------------------------------- DELETE GAME OPTION DIALOG"

    def __Initialize(self):
        self.titleBar = 0

    def Destroy(self):
        self.ClearDictionary()

        self.__Initialize()
        print " -------------------------------------- DESTROY GAME OPTION DIALOG"
  
    def __Load_LoadScript(self, fileName):
        try:
            pyScriptLoader = ui.PythonScriptLoader()
            pyScriptLoader.LoadScriptFile(self, fileName)
        except:
            import exception
            exception.Abort("OptionDialog.__Load_LoadScript")

    def __Load_BindObject(self):
        try:
            GetObject = self.GetChild
            self.titleBar = GetObject("titlebar")
          
            self.zirhci = GetObject("zirh")
            self.satici = GetObject("market")
            self.silahci = GetObject("silah")
            self.olay = GetObject("olay")
            self.balikci = GetObject("balikci")
            self.seyyar = GetObject("seyyar")
          
          
            self.zirhci.SAFE_SetEvent(self.butonlar,4)
            self.satici.SAFE_SetEvent(self.butonlar,3)
            self.silahci.SAFE_SetEvent(self.butonlar,1)
            self.olay.SAFE_SetEvent(self.butonlar,8)
            self.balikci.SAFE_SetEvent(self.butonlar,2)
            self.seyyar.SAFE_SetEvent(self.butonlar,9)

        except:
            import exception
            exception.Abort("OptionDialog.__Load_BindObject")

    def __Load(self):
        self.__Load_LoadScript("uiscript/npcekran.py")

        self.__Load_BindObject()

        self.SetCenterPosition()

        self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
      
    def butonlar(self, npc):
        net.SendChatPacket("/npcac " + str(npc))

    def butonlar2(self):
        self.Close()

    def OnPressEscapeKey(self):
        self.Close()
        return True

    def Show(self):
        ui.ScriptWindow.Show(self)

    def Close(self):
        self.Hide()
[CODE]


[CODE]
import uiScriptLocale

ROOT_PATH = "d:/ymir work/ui/public/"

TEMPORARY_X = +13
TEXT_TEMPORARY_X = -10
BUTTON_TEMPORARY_X = 5
PVP_X = -10

window = {
    "name" : "SystemOptionDialog",
    "style" : ("movable", "float",),

    "x" : 0,
    "y" : 0,

    "width" : 460,
    "height" : 365,

    "children" :
    (
        {
            "name" : "board",
            "type" : "board",

            "x" : 0,
            "y" : 0,

            "width" : 460,
            "height" : 365,

            "children" :
            (
                ## Title
                {
                    "name" : "titlebar",
                    "type" : "titlebar",
                    "style" : ("attach",),

                    "x" : 8,
                    "y" : 8,

                    "width" : 445,
                    "color" : "gray",

                    "children" :
                    (
                        {
                        "name":"titlename", "type":"text", "x":0, "y":3,
                        "horizontal_align":"center", "text_horizontal_align":"center",
                        "text" : "Uzak Market Penceresi",
                         },
                    ),
                },
#------------------------------ THINBOARD
                {
                    "name" : "thinboard1",
                    "type" : "thinboard",
                    "x": 14,
                    "y":  35,
                    "width": 313/2-25,
                    "height": 152,
                },
                {
                    "name" : "thinboard2",
                    "type" : "thinboard",
                    "x": 161,
                    "y":  35,
                    "width": 313/2-25,
                    "height": 152,
                },
                {
                    "name" : "thinboard3",
                    "type" : "thinboard",
                    "x": 310,
                    "y":  35,
                    "width": 313/2-25,
                    "height": 152,
                },
                {
                    "name" : "thinboard4",
                    "type" : "thinboard",
                    "x": 14,
                    "y":  195,
                    "width": 313/2-25,
                    "height": 152,
                },
                {
                    "name" : "thinboard5",
                    "type" : "thinboard",
                    "x": 161,
                    "y":  195,
                    "width": 313/2-25,
                    "height": 152,
                },
                {
                    "name" : "thinboard6",
                    "type" : "thinboard",
                    "x": 310,
                    "y":  195,
                    "width": 313/2-25,
                    "height": 152,
                },
#------------------------------ THINBOARD


#------------------------------ NPC IMAGE              
                {"name":"image1", "type":"image", "x":30,"y":55,"image" : "sistem/image/silah.tga"},
                {"name":"image2", "type":"image", "x":160+20,"y":55,"image" : "sistem/image/zirh.tga"},
                {"name":"image3", "type":"image", "x":290+35,"y":55,"image" : "sistem/image/market.tga"},
                {"name":"image4", "type":"image", "x":30,"y":210,"image" : "sistem/image/olay.tga"},
                {"name":"image5", "type":"image", "x":160+20,"y":210,"image" : "sistem/image/balik.tga"},
                {"name":"image6", "type":"image", "x":290+35,"y":210,"image" : "sistem/image/seyyar.tga"},
#------------------------------ NPC IMAGE

#------------------------------ TITLE BOARD IMAGE 132x18  
                {"name":"TitleBoard_01", "type":"image", "x":14,"y":35,"image" : ROOT_PATH + "titleboard.tga"},
                {"name":"TitleBoard_02", "type":"image", "x":161,"y":35,"image" : ROOT_PATH + "titleboard.tga"},  
                {"name":"TitleBoard_03", "type":"image", "x":310,"y":35,"image" : ROOT_PATH + "titleboard.tga"},
                {"name":"TitleBoard_04", "type":"image", "x":14,"y":190,"image" : ROOT_PATH + "titleboard.tga"},
                {"name":"TitleBoard_05", "type":"image", "x":161,"y":190,"image" : ROOT_PATH + "titleboard.tga"},
                {"name":"TitleBoard_06", "type":"image", "x":310,"y":190,"image" : ROOT_PATH + "titleboard.tga"},
#------------------------------ TITLE BOARD IMAGE 132x18

#------------------------------ TITLE BOARD TEXT
                {"name":"TitleBoard_Text_01", "type":"text", "x":50,"y":37,"text" : uiScriptLocale.titleboard_01,},
                {"name":"TitleBoard_Text_02", "type":"text", "x":201,"y":37,"text" : uiScriptLocale.titleboard_02,},
                {"name":"TitleBoard_Text_03", "type":"text", "x":360,"y":37,"text" : uiScriptLocale.titleboard_03,},
                {"name":"TitleBoard_Text_04", "type":"text", "x":50,"y":192,"text" : uiScriptLocale.titleboard_04,},
                {"name":"TitleBoard_Text_05", "type":"text", "x":201,"y":192,"text" : uiScriptLocale.titleboard_05,},
                {"name":"TitleBoard_Text_06", "type":"text", "x":360,"y":192,"text" : uiScriptLocale.titleboard_06,},  
#------------------------------ TITLE BOARD TEXT

#------------------------------ BUTTONS START

                {
                    "name" : "market", # Silahci
                    "type" : "button",

                    "x" : 50,
                    "y" : 40 + 25 + 25 + 10 +60,

                    "text" : uiScriptLocale.snow_text1_ibo + "|cffFF6600",

                    "default_image" : ROOT_PATH + "middle1.png",
                    "over_image" : ROOT_PATH + "middle2.png",
                    "down_image" : ROOT_PATH + "middle3.png",
                },
                {
                    "name" : "silah", #Zirhci
                    "type" : "button",

                    "x" : 200,
                    "y" : 40 + 25 + 25 + 10 +60,

                    "text" : uiScriptLocale.snow_text1_ibo,

                    "default_image" : ROOT_PATH + "middle1.png",
                    "over_image" : ROOT_PATH + "middle2.png",
                    "down_image" : ROOT_PATH + "middle3.png",
                },
                {
                    "name" : "zirh", #Market
                    "type" : "button",

                    "x" : 345,
                    "y" : 40 + 25 + 25 + 10 +60,

                    "text" : uiScriptLocale.snow_text1_ibo,

                    "default_image" : ROOT_PATH + "middle1.png",
                    "over_image" : ROOT_PATH + "middle2.png",
                    "down_image" : ROOT_PATH + "middle3.png",
                },
                {
                    "name" : "olay", #Zirhci
                    "type" : "button",

                    "x" : 50,
                    "y" : 40 + 25 + 25 + 10 +60+160,

                    "text" : uiScriptLocale.snow_text1_ibo,

                    "default_image" : ROOT_PATH + "middle1.png",
                    "over_image" : ROOT_PATH + "middle2.png",
                    "down_image" : ROOT_PATH + "middle3.png",
                },
                {
                    "name" : "balikci", #Zirhci
                    "type" : "button",

                    "x" : 200,
                    "y" : 40 + 25 + 25 + 10 +60+160,

                    "text" : uiScriptLocale.snow_text1_ibo,

                    "default_image" : ROOT_PATH + "middle1.png",
                    "over_image" : ROOT_PATH + "middle2.png",
                    "down_image" : ROOT_PATH + "middle3.png",
                },
                {
                    "name" : "seyyar", #Zirhci
                    "type" : "button",

                    "x" : 345,
                    "y" : 40 + 25 + 25 + 10 +60+160,

                    "text" : uiScriptLocale.snow_text1_ibo,

                    "default_image" : ROOT_PATH + "middle1.png",
                    "over_image" : ROOT_PATH + "middle2.png",
                    "down_image" : ROOT_PATH + "middle3.png",
                },
            ),
        },
    ),
}
[CODE]
 
Geri
Üst