当前位置: 首页>>代码示例>>Python>>正文


Python Tk.style方法代码示例

本文整理汇总了Python中Tkinter.Tk.style方法的典型用法代码示例。如果您正苦于以下问题:Python Tk.style方法的具体用法?Python Tk.style怎么用?Python Tk.style使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tkinter.Tk的用法示例。


在下文中一共展示了Tk.style方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_score

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import style [as 别名]
        return bestmove, bestscore
########################################################################
    def get_score(self,gameinstance):
        if gameinstance.is_gameover():
            if gameinstance.winner  == self.marker:
                return 1 # Won
            elif gameinstance.winner == self.opponentmarker:
                return -1 # Opponent won
        return 0 # Draw
       
########################################################################

master = Tk()
master.title("TIC TAC TOE :")
master.style = Style()
master.configure("TButton", padding=(0, 30, 0, 30),font='serif 10')
master.configure("TFrame", background="#786")

master.columnconfigure(0, pad=3)
master.columnconfigure(1, pad=3)
master.columnconfigure(2, pad=3)
			
master.rowconfigure(0, pad=3)
master.rowconfigure(1, pad=3)
master.rowconfigure(2, pad=3)
master.rowconfigure(3, pad=3)

entry = Entry(self)
entry.grid(row=0, columnspan=4, sticky=W+E)
开发者ID:rohankoul,项目名称:CL-II,代码行数:31,代码来源:min.py

示例2: change_x_axe

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import style [as 别名]
    def change_x_axe(self,*args):
        self.current_axe.set_xlim([self.xmin.get(),self.xmax.get()])  # This line set the axes to the value entered
        self.xlimit_index[self.current_row.get()-1][self.current_column.get()-1]=[self.xmin.get(),self.xmax.get()]
        self.fig.tight_layout()  # This fit all the changes
        self.canvas.draw()  # This draws the new figure

    def change_y_axe(self,*args):
        self.current_axe.set_ylim([self.ymin.get(),self.ymax.get()])
        self.ylimit_index[self.current_row.get()-1][self.current_column.get()-1]=[self.ymin.get(),self.ymax.get()]
        self.fig.tight_layout()
        self.canvas.draw()

# This is the beginnig of the main program
root=Tk()  # We create the root window, where everything will run
root.title("Plotter")  # Set a propper title
root.style=ttk.Style()
root.style.theme_use("default")
root.configure(background="lightgrey")
plotprog=plotter(root)  # Create the class that will manage all the functions

if len(sys.argv)==3:  # This allows to save a figure of wich we already have a logfile directly from terminal
    #  The prgram window will still open, but it will close but itself, this will be solved, in the future, but there are
    # things more important thatn rewriting the functions to work without the Tkinter
    plotprog.load_logfile(sys.argv[1])  # Input logfile (sys.argv[1])
    plotprog.fig.savefig(sys.argv[2])  # Output savefile  (sys.argv[2])
elif len(sys.argv)==2:
    # Load a log file
    plotprog.load_logfile(sys.argv[1])  # Input logfile (sys.argv[1])
    # Start the interactive mode
    root.mainloop()
else:
开发者ID:hadrianmontes,项目名称:Plotter,代码行数:33,代码来源:plotter.py

示例3: Tk

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import style [as 别名]
from Tkinter import Tk
from ttk import Style
import tkFileDialog

from server import RPC, Config
from server.build import BuildEventHandler
import Project

root = Tk()
root.style = Style()
root.style.theme_use('clam')
root.withdraw()

def getRecentProjects(evData):
    return Config.get('runtime', 'recent_projects')

def _pushProjectToRecentList(path):
    recent_projects = Config.get('runtime', 'recent_projects')
    try:
        # Remove current folder from path list, if it's there
        recent_projects.remove(path)
    except:
        pass

    recent_projects.insert(0, path)
    if len(recent_projects) > Config.get('project', 'recent_project_history'):
        recent_projects.pop(-1)
        pass
    Config.set('runtime', 'recent_projects', recent_projects)
    pass
开发者ID:csantosbh,项目名称:Lauen,代码行数:32,代码来源:ProjectEventHandler.py


注:本文中的Tkinter.Tk.style方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。