def get_monitors_or_default(tkroot=None): result = None if PlatformUtility.platform_is_mac() and tkroot is None: result = [Monitor(0, 0, 1920, 1080)] elif PlatformUtility.platform_is_mac() and tkroot is not None: result = [Monitor(0, 0, tkroot.winfo_screenwidth(), tkroot.winfo_screenheight())] else: result = get_monitors() return result
def get_monitors_or_default(tkroot=None): result = None if PlatformUtility.platform_is_mac() and tkroot is None: result = [Monitor(0, 0, 1920, 1080)] elif PlatformUtility.platform_is_mac() and tkroot is not None: result = [ Monitor(0, 0, tkroot.winfo_screenwidth(), tkroot.winfo_screenheight()) ] else: result = get_monitors() return result
def set_always_on_top(self): for container in self.containers: container.master.wm_attributes("-topmost", True) if PlatformUtility.platform_is_mac(): os.system('''/usr/bin/osascript -e 'tell app "Finder" to set frontmost of process "Python" to true' ''') self.focus_force() self.focus() container.master.focus_force()
def set_full_screen_always_on_top(self): self.set_always_on_top() self.remove_title_bar() self.disable_resizing() for container in self.containers: monitor = container.monitor monitor_string = "{}x{}+{}+{}".format(monitor.width, monitor.height, monitor.x, monitor.y) container.master.geometry(monitor_string) if not PlatformUtility.platform_is_mac(): container.master.wait_visibility(container.master) # Mac removing this prevented the issue with the continue screen visibility container.master.attributes("-alpha", 1)
def set_full_screen_always_on_top(self): self.set_always_on_top() self.remove_title_bar() self.disable_resizing() for container in self.containers: monitor = container.monitor monitor_string = "{}x{}+{}+{}".format(monitor.width, monitor.height, monitor.x, monitor.y) container.master.geometry(monitor_string) if not PlatformUtility.platform_is_mac(): container.master.wait_visibility( container.master) # Mac removing this prevented the issue with the continue screen visibility container.master.attributes("-alpha", 1)
def remove_title_bar(self): if PlatformUtility.platform_is_mac(): return for container in self.containers: container.master.overrideredirect(1)