Ignore:
Timestamp:
02/08/23 01:19:53 (15 months ago)
Author:
Maciej Komosinski
Message:

Introduced common utility functions for setting window sizes; untangled some repeated code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • framspy/gui/widgets/ConsoleWindow.py

    r1198 r1202  
    22from gui.widgets.ScrolledText import ScrolledText
    33from gui.framsutils.FramsSocket import FramsSocket
     4from gui.utils import windowHideAndMaximize, windowShowAndSetGeometry
    45from typing import Tuple, Callable
    56
     
    4546            return maxwidth, maxheight, x, y
    4647
    47         self.attributes("-alpha", 0)
    4848        self.update_idletasks()
    4949
    5050        width, height, x, y = parseGeometryString(self.winfo_geometry())
    51 
    52         self.state('zoomed')
    53         self.update()
     51        windowHideAndMaximize(self)
    5452        rootx = self.winfo_rootx()
    55 
    5653        maxWidth, maxHeight, x, y = parseGeometryString(self.winfo_geometry())
    57 
    58         self.state("normal")
    59         self.update()
    60 
    6154        x = (maxWidth - width) / 2
    6255        y = (maxHeight - height) / 2
    63 
    64         self.geometry("+%d+%d" % (int(rootx + x), int(y)))
    65         self.attributes("-alpha", 1)
    66         self.update()
     56        windowShowAndSetGeometry(self, "+%d+%d" % (int(rootx + x), int(y)))
    6757        self.maxsize(maxWidth, maxHeight)
    6858
Note: See TracChangeset for help on using the changeset viewer.