Jump to content

[Python]Add function to button.


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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 0

      [BUG] Skill Effects

    2. 1

      Problem with sidebar by vegas

    3. 4

      [Discussion] Rain - The First Person that leaked the M2 Files

    4. 4

      [Discussion] Rain - The First Person that leaked the M2 Files

    5. 0

      [Client] All tabs opening after quest/npc talk or even shop // PORTS

    6. 0

      Arrow does not hide at warp

    7. 1

      Problem with sidebar by vegas

    8. 58

      Discord Rich Presence

    9. 145

      Full Costume Mount System

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.