mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
removed star import
This commit is contained in:
parent
a25ea9dfa9
commit
c7e0850ea1
11
stats.py
11
stats.py
@ -19,7 +19,10 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
if platform == 'win32':
|
if platform == 'win32':
|
||||||
import ctypes
|
import ctypes
|
||||||
from ctypes.wintypes import *
|
from ctypes.wintypes import HWND, POINT, RECT, SIZE, UINT
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
import ctypes.windll # type: ignore
|
||||||
|
|
||||||
try:
|
try:
|
||||||
CalculatePopupWindowPosition = ctypes.windll.user32.CalculatePopupWindowPosition
|
CalculatePopupWindowPosition = ctypes.windll.user32.CalculatePopupWindowPosition
|
||||||
CalculatePopupWindowPosition.argtypes = [
|
CalculatePopupWindowPosition.argtypes = [
|
||||||
@ -29,7 +32,8 @@ if platform == 'win32':
|
|||||||
GetParent.argtypes = [HWND]
|
GetParent.argtypes = [HWND]
|
||||||
GetWindowRect = ctypes.windll.user32.GetWindowRect
|
GetWindowRect = ctypes.windll.user32.GetWindowRect
|
||||||
GetWindowRect.argtypes = [HWND, ctypes.POINTER(RECT)]
|
GetWindowRect.argtypes = [HWND, ctypes.POINTER(RECT)]
|
||||||
except: # Not supported under Wine 4.0
|
|
||||||
|
except Exception: # Not supported under Wine 4.0
|
||||||
CalculatePopupWindowPosition = None
|
CalculatePopupWindowPosition = None
|
||||||
|
|
||||||
|
|
||||||
@ -333,7 +337,8 @@ class StatsResults(tk.Toplevel):
|
|||||||
GetWindowRect(GetParent(self.winfo_id()), position)
|
GetWindowRect(GetParent(self.winfo_id()), position)
|
||||||
if CalculatePopupWindowPosition(
|
if CalculatePopupWindowPosition(
|
||||||
POINT(parent.winfo_rootx(), parent.winfo_rooty()),
|
POINT(parent.winfo_rootx(), parent.winfo_rooty()),
|
||||||
SIZE(position.right - position.left, position.bottom - position.top),
|
# - is evidently supported on the C side
|
||||||
|
SIZE(position.right - position.left, position.bottom - position.top), # type: ignore
|
||||||
0x10000, None, position
|
0x10000, None, position
|
||||||
):
|
):
|
||||||
self.geometry("+%d+%d" % (position.left, position.top))
|
self.geometry("+%d+%d" % (position.left, position.top))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user