Jump to content
  • 0

[Python]Add function to button.


Rexors

Question

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
Share on other sites

  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

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.