Metin2 Hungarian Forum

Metin2 => Szerver készítés => Privát szerverek => Segítség => A témát indította: Joe Dátum 2017-11-29, 13:15:13

Cím: Optcserélő gomb, show() hide()
Írta: Joe Dátum 2017-11-29, 13:15:13
Beraktam egy gombot a leltárba, a gomb működik is előhozza amit kell
annyi lenne vele a probléma hogy amikor másodjára kattintok rá nem tűnik el


itt a funkció


def ClickSwitchboot(self):
import uiswitchbot
if constInfo.SWITCHBOT == 0:
constInfo.SWITCHBOT = 1
uiswitchbot.Bot().Show()
elif constInfo.SWITCHBOT == 1:
constInfo.SWITCHBOT = 0
uiswitchbot.Bot().kill_window()



így is próbáltam

uiswitchbot.Bot().Hide()
uiswitchbot.Bot()._Hide()

így semvolt jó

az uiswitchbot:
https://pastebin.com/0FY5H5zf​


Remélem tud valaki segíteni
Cím: Re:Optcserélő gomb, show() hide()
Írta: 5310pati Dátum 2017-11-29, 20:28:05
Próbáld meg h berakod 1 változóba, itt 1 példa sajátomról:
def __WhisBot(self):
self.wb = whisbot.SwitchbotDialog()
if constInfo.WHISBOT == 0:
self.wb.Show()
constInfo.WHISBOT = 1
else:
self.wb.Hide()
constInfo.WHISBOT = 0


Edit: Az importot meg a fájl elejére csapnám a többi mellé, h ne importálgasson minden gomblenyomáskor.
EhPortal 1.39 © 2025, WebDev