|
53 | 53 |
|
54 | 54 |
|
55 | 55 | APP_NAME = 'Python Easy Chess GUI' |
56 | | -APP_VERSION = 'v0.66' |
| 56 | +APP_VERSION = 'v0.67' |
57 | 57 | BOX_TITLE = '{} {}'.format(APP_NAME, APP_VERSION) |
58 | 58 |
|
59 | 59 |
|
@@ -1958,24 +1958,26 @@ def main_loop(self): |
1958 | 1958 | continue |
1959 | 1959 |
|
1960 | 1960 | if button == 'Flip': |
1961 | | - # Clear Text and Multiline elements |
1962 | 1961 | self.window.FindElement('_gamestatus_').Update('Mode Neutral') |
1963 | 1962 | self.clear_elements() |
1964 | 1963 |
|
1965 | | - window1 = sg.Window('{} {}'.format(APP_NAME, APP_VERSION), |
| 1964 | + # Get the current location of window before closing it. |
| 1965 | + # We will use this loc when we create a new window. |
| 1966 | + loc = self.window.CurrentLocation() |
| 1967 | + self.window.Close() |
| 1968 | + |
| 1969 | + self.window = sg.Window('{} {}'.format(APP_NAME, APP_VERSION), |
1966 | 1970 | self.black_layout if self.is_user_white else self.white_layout, |
1967 | 1971 | default_button_element_size=(12, 1), |
1968 | | - auto_size_buttons=False, |
1969 | | - icon='') |
| 1972 | + auto_size_buttons=False, location=(loc[0], loc[1]), |
| 1973 | + keep_on_top = True, icon='') |
1970 | 1974 | self.is_user_white = not self.is_user_white |
1971 | 1975 |
|
1972 | 1976 | self.update_labels_and_game_tags(human='Human', |
1973 | 1977 | engine_id=engine_id_name) |
1974 | | - |
1975 | | - self.window.Close() |
1976 | 1978 | self.psg_board = copy.deepcopy(initial_board) |
1977 | 1979 | board = chess.Board() |
1978 | | - self.window = window1 |
| 1980 | + self.window.Refresh() |
1979 | 1981 | continue |
1980 | 1982 |
|
1981 | 1983 | # Menu->Help->Help |
|
0 commit comments