Changeset 1202 for framspy/gui/utils.py


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
  • TabularUnified framspy/gui/utils.py

    r1198 r1202  
    3232        self.two = self.init
    3333
     34
    3435#source: https://gist.github.com/walkermatt/2871026
    3536def debounce(wait):
     
    4950        return debounced
    5051    return decorator
     52
     53
     54# https://stackoverflow.com/questions/39058038/wm-attributes-and-zoomed-doesnt-work
     55# https://stackoverflow.com/questions/18394597/is-there-a-way-to-create-transparent-windows-with-tkinter
     56def windowHideAndMaximize(wnd): # to get the size of working area on screen (screen minus taskbars, toolbars etc.) - make invisible maximized window
     57    wnd.attributes("-alpha", 0)
     58    wnd.state('zoomed')
     59    wnd.update()
     60
     61def windowShowAndSetGeometry(wnd, geometry):
     62    wnd.state('normal')
     63    wnd.update()
     64    wnd.geometry(geometry)
     65    wnd.attributes("-alpha", 1)
     66    wnd.update()
Note: See TracChangeset for help on using the changeset viewer.