本文整理汇总了Python中Tkinter.Tk.iconify方法的典型用法代码示例。如果您正苦于以下问题:Python Tk.iconify方法的具体用法?Python Tk.iconify怎么用?Python Tk.iconify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tkinter.Tk
的用法示例。
在下文中一共展示了Tk.iconify方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: gui
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import iconify [as 别名]
def gui():
global gui_root
sys.path.append("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk")
sys.path.append("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/")
# Wait for ui_server startup
while not (sys.modules.get("main") and "ui_server" in dir(sys.modules["main"]) and getattr(sys.modules["main"].ui_server, "server", None)):
time.sleep(0.1)
def click():
import webbrowser
webbrowser.open("http://127.0.0.1:43110")
def quit():
sys.exit(0)
try:
from Tkinter import Tk
gui_root = Tk()
gui_root.iconify()
gui_root.createcommand('tk::mac::ReopenApplication', click)
gui_root.createcommand('tk::mac::Quit', quit)
if not os.environ.get("SECURITYSESSIONID"): # Not started by auto-run
click()
gui_root.mainloop()
except ExitCommand:
print "Stopping..."
except Exception, err:
print "Gui error: %s" % err
while 1:
time.sleep(1000)
示例2: GUI
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import iconify [as 别名]
class GUI():
def __init__(self):
self.root = Tk()
self.show()
def show(self):
self.root.deiconify()
#self.root.attributes('-topmost', 1)
#self.root.attributes('-topmost', 0)
self.root.after(2000, self.hide)
def hide(self):
self.root.iconify()
self.root.after(2000, self.show)
示例3: Tk
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import iconify [as 别名]
array, angle, arange, pi, sin, real,
imag, sqrt, abs, log10, concatenate,
)
import phringes.backends.sma as sma
from phringes.backends.basic import NoCorrelations
from phringes.plotting.rtplot import RealTimePlot
logging.basicConfig()
logger = logging.getLogger()
logger.setLevel(logging.INFO)
root = Tk()
root.iconify()
root.wm_title("Correlator Monitor")
frame = Frame(root)
frame.pack(fill=BOTH, expand=1)
correlator = sma.BEE2CorrelatorClient(gethostbyname(gethostname()), 8332)
server = sma.SubmillimeterArrayClient('128.171.116.126', 59998)
try:
server.subscribe(correlator.host, correlator.port)
except:
pass
server.start_correlator()
f = arange(-7, 8)
corr = RealTimePlot(master=frame, mode='replace', ylim=[-pi, pi], xlim=[f.min(), f.max()])