MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / center

Function center

lib/utils/gui.py:109–120  ·  view source on GitHub ↗
(window)

Source from the content-addressed store, hash-verified

107
108 # Reference: https://stackoverflow.com/a/10018670
109 def center(window):
110 window.update_idletasks()
111 width = window.winfo_width()
112 frm_width = window.winfo_rootx() - window.winfo_x()
113 win_width = width + 2 * frm_width
114 height = window.winfo_height()
115 titlebar_height = window.winfo_rooty() - window.winfo_y()
116 win_height = height + titlebar_height + frm_width
117 x = window.winfo_screenwidth() // 2 - win_width // 2
118 y = window.winfo_screenheight() // 2 - win_height // 2
119 window.geometry('{}x{}+{}+{}'.format(width, height, x, y))
120 window.deiconify()
121
122 def onKeyPress(event):
123 global line

Callers 2

runFunction · 0.85
runGuiFunction · 0.85

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…