Jump to content

Recommended Posts

Hello guys, I have some problem with add function to my button in inventory.

 

I create new .py file with gui and add some to game.py with easy function opening/closing my gui

def __GuiWindow(self):
self.Gui.Open()

and running this from hotkey

onPressKeyDict[app.DIK_TAB] = lambda : self.__GuiWindow()

That work great but my problem start when i try change hotkey to button. I dont know how to hook to function def GuiWindow(self): from game.py to button in uiinventory.py

self.GuiButton.SetEvent(ui.__mem_func__(self.XXXXXXXXX))

I try some like this 

import game

self.gui = game.GameWindow()

self.GuiButton.SetEvent(ui.__mem_func__(self.gui.__GuiWindow))

but wasn`t work. 

 

Link to comment
https://metin2.dev/topic/4251-pythonadd-function-to-button/
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.