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


Python Frame.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
    def __init__(self, parent):
        self.Data = Data()
        self.getReciepList()

        Frame.__init__(self, parent)

        self.parent = parent

        self.recipeList = None  # Listbox
        self.recipeName = None  # Entry
        self.prepTime = None  # Entry
        self.prepTimeUnit = None  # OptionMenu
        self.cookTime = None  # Entry
        self.cookTimeUnit = None  # OptionMenu
        self.ingredientName = None  # Entry
        self.ingredientQuantity = None  # Entry
        self.ingredientUnit = None  # OptionMenu
        self.ingredientList = None  # Listbox
        self.procedure = None  # Text

        self.recipes = []
        self.ingredients = []
        self.activeRecipeID = {"lst": None, "db": None}  # (listID, dbID)
        self.activeIngredientID = {"lst": None, "db": None}  # (listID, dbID)

        self.initUI()

        self.bind_all("<Control-w>", self.onExit)
        self.bind_all("<Control-s>", self.recipeSave)
开发者ID:RagingRoosevelt,项目名称:RecipeManagerV2,代码行数:31,代码来源:gui.py

示例2: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
 def __init__(self, parent):
     Frame.__init__(self, parent)
     self.parent = parent
     self.grid()
     self.init_ui()
     self.wallhandler = WallHandler()
     self.reddit = Reddit()
开发者ID:jflowaa,项目名称:papers,代码行数:9,代码来源:paper_gui.py

示例3: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
    def __init__(self, parent, i, j, callback_edit, **options):
        Frame.__init__(self, parent, **options)
        # grid layout
        self.rowconfigure(0, weight=1)
        self.rowconfigure(1, weight=1)
        self.rowconfigure(2, weight=1)
        self.columnconfigure(0, weight=1)
        self.columnconfigure(1, weight=1)
        self.columnconfigure(2, weight=1)
        # styles
        self.configure(style="case.TFrame")

        self.i = i
        self.j = j
        self.modifiable = True
        self.val = 0 # valeur de la case, 0 = vide
        self.possibilites = [] # possibilites écrites dans la case
        self.callback_edit = callback_edit

        # labels
        self.chiffres = [] # tableau 3x3 de labels permettant d'afficher les chiffres dans la case
        sticky_i = ["n", "ns", "s"]
        sticky_j = ["w", "ew", "e"]
        for i in range(3):
            self.chiffres.append([])
            for j in range(3):
                self.chiffres[i].append(Label(self, text=" ", anchor="center",
                                                  style="case.TLabel", width=1))
                self.chiffres[i][j].grid(row=i, column=j,
                                         sticky=sticky_i[i % 3] + sticky_j[j % 3],
                                         padx=1, pady=1)
开发者ID:j4321,项目名称:Sudoku-Tk,代码行数:33,代码来源:case.py

示例4: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
    def __init__(self, master):
        """Construct a Box frame with parent master.

        Args:
            master: The parent frame.
        """
        Frame.__init__(self, master, style=styles.BOX_FRAME)
        self.position = (0, 0)
        self.binding_tag = 'BoxFrame' + str(Box._counter)
        self.number_text = StringVar(self, '')
        Box._counter += 1

        self.borders = dict()
        for edge in 'nesw':
            self.borders[edge] = Border(self, edge)

        self.inner_frame = Frame(self, width=30, height=30, style=styles.BOX_FRAME)
        self.pencil_marks = _build_3x3_grid(self.inner_frame, Pencil)

        self.label = Label(self.inner_frame, textvariable=self.number_text, style=styles.NUMBER_LABEL)

        _tag_widget(self, self.binding_tag)
        _tag_widget(self.inner_frame, self.binding_tag)
        _tag_widget(self.label, self.binding_tag)
        for mark in self.pencil_marks:
            _tag_widget(mark, self.binding_tag)
            _tag_widget(mark.label, self.binding_tag)
开发者ID:Tinister,项目名称:SudokuSolver,代码行数:29,代码来源:frames.py

示例5: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
    def __init__(self, parent):
        Frame.__init__(self, parent)   
         
        self.parent = parent 

        self.music_root = ''
        self.query_path = ''
        self.extractor = Extractor(n_frames=40, 
                                   n_blocks=100, 
                                   learning_rate=0.00053,
                                   verbose=True)

        self.style = Style()
        self.style.theme_use("default")
        
        padx = 2
        pady = 2

        root_select_button = Button(self, text="Select a directory")
        root_select_button.pack(fill=tkinter.X, padx=padx, pady=pady)
        root_select_button.bind("<Button-1>", self.set_music_root)

        analyze_button = Button(self, text="Analyze")
        analyze_button.pack(fill=tkinter.X, padx=padx, pady=pady)
        analyze_button.bind("<Button-1>", self.analyze)

        query_select_button = Button(self, text="Select a file")
        query_select_button.pack(fill=tkinter.X, padx=padx, pady=pady)
        query_select_button.bind("<Button-1>", self.set_query_path)

        search_button = Button(self, text="Search similar songs")
        search_button.pack(fill=tkinter.X, padx=padx, pady=pady)
        search_button.bind("<Button-1>", self.search_music)
 
        self.pack(fill=BOTH, expand=1)
开发者ID:IshitaTakeshi,项目名称:Lyra,代码行数:37,代码来源:gui.py

示例6: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
    def __init__(self, master, origin=(0, 0)):
        Frame.__init__(self, master)
        self.origin = origin
        self.goban = golib.gui.Goban(self)
        self.buttons = Frame(self)
        self.ctx_event = None  # save the event that has originated the context menu
        self.msg = tk.StringVar(value="Hello")
        self.err = tk.StringVar(value="-")
        self.create_menubar()
        self.init_components()

        self.closed = False

        # user input part of the gui, delegated to goban ATM. may become lists later
        self.mousein = self.goban
        self.keyin = self.goban

        # these commands are expected to be set from outside, in an attempt to inject dependency via setter.
        # See 'controller' classes who instantiate some of these commands.
        self.commands = {}
        self.master.protocol("WM_DELETE_WINDOW", lambda: self.execute("close"))
        self.commands["close"] = lambda: self.master.quit()  # this command needs a default value

        # delegate some work to goban
        self.stones_changed = self.goban.stones_changed
        self.highlight = self.goban.highlight
        self.select = self.goban.select
        self.clear = self.goban.clear
开发者ID:ArnaudPel,项目名称:Golib,代码行数:30,代码来源:ui.py

示例7: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
	def __init__(self,parent):
		
		Frame.__init__(self, master=parent)

		canvas = tkinter.Canvas(self, highlightthickness=0)
		self.innerFrame = Frame(canvas)

		myscrollbar = Scrollbar(self, orient="vertical")
		myscrollbar.configure(command=canvas.yview)

		def scrollbarSet(top, bottom):
			# Hides and shows the scroll frame depending on need
			if float(top) > 0 or float(bottom) < 1:
				myscrollbar.grid(row=0, column=1, sticky="NS")
			else:
				pass
				myscrollbar.grid_remove()
			myscrollbar.set(top, bottom)
		canvas.configure(yscrollcommand = scrollbarSet)


		configureFunc = lambda _ :  canvas.configure(scrollregion=canvas.bbox("all"))
		frameID = canvas.create_window((0,0), window=self.innerFrame, anchor='nw')
		self.innerFrame.bind("<Configure>",configureFunc)

		canvas.grid(row=0, column=0, sticky="NSEW")
		myscrollbar.grid(row=0, column=1, sticky="NS")
		self.grid_rowconfigure(0, weight=1)
		self.grid_columnconfigure(0, weight=0)


		#canvas.bind("<Configure>", lambda e : canvas.itemconfig(frameID, width=e.width))
		canvas.bind("<Configure>", lambda e : canvas.configure(width=self.innerFrame.winfo_width()))
开发者ID:volcan01010,项目名称:AshCalc,代码行数:35,代码来源:custom_components.py

示例8: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
    def __init__(self, parent):
        Frame.__init__(self, parent)

        self.parent = parent
        self.grid(sticky=N+E+S+W)

        self.initui()
开发者ID:arran-dengate,项目名称:light-pollution,代码行数:9,代码来源:controller.py

示例9: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
 def __init__(self, master):
     Frame.__init__(self, master, padding="0 0 0 13")
     Separator(self).grid(row=0, columnspan=2, pady="0 9", sticky=EW)
     self.button = Button(self, text="Close", command=master.destroy)
     self.button.grid(row=1, column=0, padx="15", sticky=E)
     self.grid(sticky=EW)
     self.columnconfigure(0, weight=1)
开发者ID:jwdafoe,项目名称:ContactPro,代码行数:9,代码来源:gui.py

示例10: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
 def __init__(self, master, width=0, height=0, sid=None, **kwargs):
     Frame.__init__(self, master, width=width, height=height)
     self.master = master
     self.width = width
     self.height = height
     self.sid = sid
     self.text_widget = Text(self, **kwargs)
     self.text_widget.pack(expand=True, fill="both")
开发者ID:Exodus111,项目名称:Projects,代码行数:10,代码来源:load.py

示例11: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
 def __init__(self, parent, *args, **kwargs):
     #pylint:disable=super-init-not-called
     Frame.__init__(self, parent, *args, **kwargs)
     self.parent = parent
     self.pack(side=TOP, fill=BOTH, expand=Y)
     self.create_variables()
     self.create_controls()
     self.read_data()
开发者ID:PeridexisErrant,项目名称:python-lnp,代码行数:10,代码来源:tab.py

示例12: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
 def __init__(self, master, train_dir):
     Frame.__init__(self, master)
     self.dir = train_dir
     self.manager = NNManager()
     self.img_list = ImgList(self)
     self.img_list.pack()
     Button(self, text='Histo', command=self.histo).pack()
     Button(self, text='Train', command=self.train).pack()
开发者ID:ArnaudPel,项目名称:CamKifu,代码行数:10,代码来源:training_ui.py

示例13: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
 def __init__(self, lnp, parent):
     #pylint:disable=super-init-not-called
     Frame.__init__(self, parent)
     self.pack(side=TOP, fill=BOTH, expand=Y)
     self.lnp = lnp
     self.create_variables()
     self.create_controls()
     self.read_data()
开发者ID:Estevo-Aleixo,项目名称:pylnp,代码行数:10,代码来源:tab.py

示例14: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
 def __init__(self,parent):
     Frame.__init__(self , parent)
     self.enc1 = Encoder(21)
     self.parent = parent
     self.conexion = True#is_connected()
     self.est_pinza = 1
     self.est_subebaja = 1
     self.initUI()
开发者ID:bojack5,项目名称:fisherpi,代码行数:10,代码来源:hmi.py

示例15: __init__

# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import __init__ [as 别名]
 def __init__(self, parent):
     Frame.__init__(self, parent)
     self.parent = parent
     self.info = {}
     self.window = None
     self.size = (640, 480)
     self.fields = []
     self.init_ui()
开发者ID:Exodus111,项目名称:Projects,代码行数:10,代码来源:main.py


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