Forum Moderator VegaS™ 10275 Posted August 27, 2018 Forum Moderator Share Posted August 27, 2018 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) This is the hidden content, please Sign In or Sign Up ( GitHub ) This is the hidden content, please Sign In or Sign Up 36 1 1 1 2 6 29 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Contributor MrQuin 6409 Posted August 27, 2018 Contributor Share Posted August 27, 2018 Can you show us an example? and welcome back My only accounts are here and on M2D, Don't trust anyone else from other shitty sites. Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10275 Posted August 27, 2018 Author Forum Moderator Share Posted August 27, 2018 21 minutes ago, MrQuin said: Can you show us an example? root/main.py Spoiler import ui, exception, dbg class MainWindow(ui.ScriptWindow): def __init__(self): ui.ScriptWindow.__init__(self) self.__LoadWindow() def __del__(self): ui.ScriptWindow.__del__(self) def Destroy(self): self.ClearDictionary() def __LoadWindow(self): try: ui.PythonScriptLoader().LoadScriptFile(self, "uiScript/main_window.py") except: exception.Abort("MainWindow.__LoadWindow.LoadWindow") try: self.childrenDict = self.GetChildDictionary("HideButton", "ShowButton", "UpdateButton") except: import exception exception.Abort('MainWindow.__LoadWindow.BindObject') for tabKey, tabButton in enumerate(self.childrenDict.values()): tabButton.SAFE_SetEvent(self.__OnToggleDown, tabKey) def __OnToggleDown(self, index): dbg.LogBox('__OnToggleDown {:d}'.format(index)) if index == 0: # HideButton self.SAFE_SetDictionaryEvent(self.childrenDict, ('Hide')) elif index == 1: # ShowButton self.SAFE_SetDictionaryEvent(self.childrenDict, ('Show')) elif index == 2: # UpdateButton self.SAFE_SetDictionaryEvent(self.childrenDict, ('UpdateRect', 'SetTop', 'SetCenterPosition', 'Lock')) uiscript/main_window.py Spoiler import uiScriptLocale UI_WIDTH = 115 UI_HEIGHT = 130 window = { "name" : "MainWindow", "style" : ("movable", "float",), "x" : SCREEN_WIDTH / 2 - UI_WIDTH / 2, "y" : SCREEN_HEIGHT / 2 - UI_HEIGHT / 2, "width" : UI_WIDTH, "height" : UI_HEIGHT, "children" : ( { "name" : "Board", "type" : "board_with_titlebar", "x" : 0, "y" : 0, "width" : UI_WIDTH, "height" : UI_HEIGHT, "title" : "Window", "children" : ( { "name" : "HideButton", "type" : "button", "x" : 15, "y" : 40, "text" : "HideButton", "default_image" : "d:/ymir work/ui/public/large_button_01.sub", "over_image" : "d:/ymir work/ui/public/large_button_02.sub", "down_image" : "d:/ymir work/ui/public/large_button_03.sub", }, { "name" : "ShowButton", "type" : "button", "x" : 15, "y" : 40 + (30 * 1), "text" : "ShowButton", "default_image" : "d:/ymir work/ui/public/large_button_01.sub", "over_image" : "d:/ymir work/ui/public/large_button_02.sub", "down_image" : "d:/ymir work/ui/public/large_button_03.sub", }, { "name" : "UpdateButton", "type" : "button", "x" : 15, "y" : 40 + (30 * 2), "text" : "UpdateButton", "default_image" : "d:/ymir work/ui/public/large_button_01.sub", "over_image" : "d:/ymir work/ui/public/large_button_02.sub", "down_image" : "d:/ymir work/ui/public/large_button_03.sub", }, ), }, ), } Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10275 Posted October 1, 2019 Author Forum Moderator Share Posted October 1, 2019 Moved to: This is the hidden content, please Sign In or Sign Up 6 4 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Recommended Posts