Ignore:
Timestamp:
02/08/23 01:19:53 (2 years 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/propertyWindow.py

    r1198 r1202  
    44from typing import Dict, List, Callable, Tuple
    55from gui.framsutils.framsProperty import Property, PropertyCallback, propertyToTkinter
     6from gui.framsutils.FramsInterface import FramsInterface, InterfaceType
    67from gui.widgets.ToolTip import CreateToolTip
    7 from gui.framsutils.FramsInterface import FramsInterface, InterfaceType
     8from gui.utils import windowHideAndMaximize, windowShowAndSetGeometry
    89
    910'''
     
    105106            return maxwidth, maxheight, x, y
    106107
    107         self.attributes("-alpha", 0)
    108108        self.update_idletasks()
    109109
    110110        width, height, x, y = parseGeometryString(self.winfo_geometry())
    111111
    112         self.state('zoomed')
    113         self.update()
     112        windowHideAndMaximize(self)
    114113        rootx = self.winfo_rootx()
    115114
    116115        maxWidth, maxHeight, x, y = parseGeometryString(self.winfo_geometry())
    117 
    118         self.state("normal")
    119         self.update()
    120 
    121116        x = (maxWidth - width) / 2
    122117        y = (maxHeight - height) / 2
    123118
    124         self.geometry("+%d+%d" % (int(rootx + x), int(y)))
    125         self.attributes("-alpha", 1)
    126         self.update()
     119        windowShowAndSetGeometry(self, "+%d+%d" % (int(rootx + x), int(y)))
    127120        self.maxsize(maxWidth, maxHeight)
    128121
Note: See TracChangeset for help on using the changeset viewer.