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


Python Frame.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import __init__ [as 别名]
 def __init__(self,parent=None):
     'constructor'
     Frame.__init__(self, parent)
     # If you use pack for the widgets in make_widgets, change
     # this to pack
     self.grid()
     CreditCard.make_widgets(self)
开发者ID:wpank,项目名称:Python,代码行数:9,代码来源:CreditCardInterest.py

示例2: __init__

# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import __init__ [as 别名]
 def __init__(self, bg='black', parent=None):
     Frame.__init__(self, bg='black', parent=None)
     #self.title("CTA Train Tracker ")
     self.driv = driver.Driver()
     self.pack()
     self.memory=''
     traintracker.make_widgets(self)
开发者ID:dahlke,项目名称:PyTrain,代码行数:9,代码来源:traintracker.py

示例3: __init__

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

        '''Initialization method.'''

        Frame.__init__(self, parent)

        button_frame = Frame(self)
        button_frame.pack(side=TOP)

        self.deal_button = Button(button_frame, text="Deal",
                                  command=lambda: handler("deal"))
        self.deal_button.pack(side=LEFT, padx=5, pady=5)

        self.quit_button = Button(button_frame, text="Quit",
                                  command=lambda: handler("quit"))
        self.quit_button.pack(side=RIGHT, padx=5, pady=5)

        self.exchange_button = Button(button_frame, text="Exchange",
                                      command=lambda: handler("exchange"))
        self.exchange_button.pack(side=RIGHT, padx=5, pady=5)

        self.show_button = Button(button_frame, text="Show",
                                  command=lambda: handler("show"))
        self.show_button.pack(side=RIGHT, padx=5, pady=5)

        label_frame = Frame(self)
        label_frame.pack(side=BOTTOM)

        self.status_label = Label(label_frame, relief=SUNKEN)
        self.set_status_text("No text to show")
        self.status_label.pack(side=TOP, padx=5, pady=5)
开发者ID:paulgriffiths,项目名称:videopoker,代码行数:33,代码来源:chw.py

示例4: __init__

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

        '''Initialization method.'''

        Frame.__init__(self, parent)

        # Set playing cards and miscellaneous variables

        self._deck = pcards.Deck()
        self._hand = pcards.Hand(self._deck)
        self._num_cards = num_cards
        self._parent = parent

        # Create and pack card hand widget

        card_images = (pcards.CardImagesLarge if use_large_images
                       else pcards.CardImagesSmall)

        self._chw = pcards.CardHandWidget(self, card_images,
                                          numcards=self._num_cards,
                                          relief=SUNKEN, borderwidth=2)
        self._chw.pack(side=TOP, padx=5, pady=5)

        # Create and pack control buttons widget

        button_defs = [
            ("Deal", self._deal),
            ("Exchange", self._exchange),
            ("Clear", self._clear),
            ("Quit", self._quit)
            ]

        bbw = ButtonBarWidget(self, button_defs)
        bbw.pack(side=BOTTOM)
开发者ID:paulgriffiths,项目名称:pcards,代码行数:36,代码来源:chw_demo_simple.py

示例5: __init__

# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import __init__ [as 别名]
 def __init__(self, parent):
     Frame.__init__(self, parent, background="white")   
      
     self.parent = parent
     self.parent.title("Centered window")
     self.pack(fill=BOTH, expand=1)
     self.centerWindow()
开发者ID:gddickinson,项目名称:python_code,代码行数:9,代码来源:centeredWindow.py

示例6: __init__

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

        self.text = Text(self)
        self.text.pack(side="top", fill="both", expand=True)
        self.text.tag_configure("current", background="#e9e9e9")
        self.highlight_current_line()
开发者ID:dossan,项目名称:tkinter,代码行数:9,代码来源:highlight_current_line.py

示例7: __init__

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

        self.creatures_names_list = [""] * 12
        self.environment = StringVar()
        self.chance = StringVar()

        Label(self, text="Environment of the Encounter :").grid(row=0, column=0, columnspan=3)
        Label(self, text="Chance of the Encounter :").grid(row=1, column=0, columnspan=3)
        Label(self, text=" %").grid(row=1, column=4)
        Label(self, text="1 :").grid(row=2, column=0)
        Label(self, text="2 :").grid(row=3, column=0)
        Label(self, text="3 :").grid(row=4, column=0)
        Label(self, text="4 :").grid(row=5, column=0)
        Label(self, text="5 :").grid(row=6, column=0)
        Label(self, text="6 :").grid(row=7, column=0)
        Label(self, text="7 :").grid(row=2, column=4)
        Label(self, text="8 :").grid(row=3, column=4)
        Label(self, text="9 :").grid(row=4, column=4)
        Label(self, text="10 :").grid(row=5, column=4)
        Label(self, text="11 :").grid(row=6, column=4)
        Label(self, text="12 :").grid(row=7, column=4)
        Label(self, text="AC :").grid(row=3, column=7)
        Label(self, text="HP :").grid(row=4, column=7)
        Label(self, text="ATK :").grid(row=5, column=7)
        Label(self, text="DMG :").grid(row=6, column=7)
        Label(self, text="NUMBER :").grid(row=7, column=7)
        Label(self, text="SAVES:").grid(row=8, column=7)
        Label(self, text="ALIGN :").grid(row=9, column=7)
        Label(self, text="XP :").grid(row=10, column=7)
开发者ID:jkesselring,项目名称:DnDApp,代码行数:32,代码来源:encounters.py

示例8: __init__

# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import __init__ [as 别名]
    def __init__(self):
        """ Create the initial application GUI environment (tool bars, and other static elements) """
        Frame.__init__(self, self.root)
        self.thread_entry_field = ''  # Hold both search string, and drives autoRefresh logic

        self.menuBar = Menu()
        self.fileMenu = Menu(self.menuBar, tearoff=0)
        self.menuBar.add_cascade(label="File", menu=self.fileMenu, underline=1)
        self.fileMenu.add_command(label="Quit", command=self.root.destroy, underline=1)

        self.optionsMenu = Menu(self.menuBar, tearoff=0)
        self.menuBar.add_cascade(label="Options", menu=self.optionsMenu)
        self.optionsMenu.add_command(label="Settings", command=self.editSettings, underline=1)
        self.helpMenu = Menu(self.menuBar, tearoff=0)
        self.menuBar.add_cascade(label="Help", menu=self.helpMenu)
        self.helpMenu.add_command(label="Help", command=self.program_help, underline=1)
        self.helpMenu.add_command(label="About", command=self.program_about, underline=1)
        self.master.config(menu=self.menuBar)

        self.topFrame = Frame()
        self.thread_entry_box = Entry(self.topFrame)
        self.thread_entry_box.insert(0, self.DEFAULT_THREAD_TEXT)
        self.thread_entry_box.bind('<Return>', lambda event: self.add_thread_GUI())
        # Bind needs to send the event to the handler
        self.thread_entry_box.pack(side='left', fill='x', expand='True', padx=5)

        self.add_thread_btn = Button(self.topFrame)
        self.add_thread_btn['text'] = 'Add New Thread'
        self.add_thread_btn['command'] = lambda: self.add_thread_GUI()
        self.add_thread_btn.pack(side='left', padx=0)

        self.topFrame.pack(fill='x')

        self.create_thread_frame()
开发者ID:Jelloeater,项目名称:chanThreadWatcher,代码行数:36,代码来源:view.py

示例9: __init__

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

        Initialise GameOfLife object
        Build the gui, bind events and initialise the display
        '''
        # Encasing frame
        tk = Tk()
        Frame.__init__(self, master=tk)

        # Grid frame
        self._grid = GridWidget(self, X_SIZE, Y_SIZE)
        for row in self._grid.get_cells():
            for cell in row:
                cell.bind('<Button-1>', self._cell_listener)

        # buttons
        self._next_button = NextButton(master=self)
        self._next_button.bind('<Button-1>', self._next_step_button_listener)

        # Set layout
        self._grid.grid(row=0, column=0)
        self._next_button.grid(row=0, column=1)

        # Game of life
        self._gol = GameOfLife(RuleSetStandard(), self._grid)

        self.pack()
        self._grid.pack()
        self._next_button.pack()
开发者ID:leahcimNosliw,项目名称:Game_of_life,代码行数:33,代码来源:gui.py

示例10: __init__

# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import __init__ [as 别名]
 def __init__(self, master=None):
     Frame.__init__(self, master)
     self.pack(expand=1, fill='both')
     self.master.geometry('1440x900')
     paned_window = PanedWindow(self)
     self.treeview_kspelements = TreeviewKSPElements(self)
     self.treeview_kspobjects = TreeviewKSPObjects(self)
     paned_window.pack(expand=1, fill='both')
     paned_window.add(self.treeview_kspelements)
     paned_window.add(self.treeview_kspobjects)
     
     menubar = Menu(self)
     
     filemenu = Menu(self)
     filemenu.add_command(label='Open', command=self._open)
     filemenu.add_command(label='Save', command=self._save)
     filemenu.add_command(label='Save As', command=self._save_as)
     filemenu.add_separator()
     filemenu.add_command(label='Exit', command=self.master.destroy)
     menubar.add_cascade(menu=filemenu, label='File')
     
     insertmenu = Menu(self)
     insertmenu.add_command(label='KSP Element', command=self._insert_element, state='disabled')
     insertmenu.add_command(label='KSP Object', command=self._insert_object)
     menubar.add_cascade(menu=insertmenu, label='Insert')
     self.master.config(menu=menubar)
开发者ID:dan2082,项目名称:KSPData,代码行数:28,代码来源:main.py

示例11: __init__

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

        self.parentWindow = 0

        self.listBox = Listbox(self, selectmode=EXTENDED)
        self.listBox.grid(row=1, column=1)
        for item in ["one", "two", "three", "four"]:
            self.listBox.insert(END, item)
        
        self.buttonDel = Button(self,
                                text="delite selected class",
                                command=self.del_selected)  # lambda ld=self.listBox:ld.delete(ANCHOR))
        self.buttonDel.grid(row=0, column=0)
            
        self.entry = Entry(self, state=NORMAL)
        # self.entry.focus_set()
        self.entry.insert(0, "default")
        self.entry.grid(row=1, column=0)
        
        self.buttonInsert = Button(self, text="add new class",
                                   command=self.add)
        self.buttonInsert.grid(row=0, column=1)
        
        self.buttonDone = Button(self, text="done", command=self.done)
        self.buttonDone.grid(row=2, column=0)
开发者ID:valdecar,项目名称:faceRepresentWithHoG,代码行数:32,代码来源:gui.py

示例12: __init__

# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import __init__ [as 别名]
 def __init__(self, parent):
     """ This method creates a new, emtpy LpoView. """
     Frame.__init__(self, parent)
     self.__parent = parent
     self.__initUI()
     
     self.__lpo = None
开发者ID:irgangla,项目名称:pntools,代码行数:9,代码来源:lpo_viewer_tk.py

示例13: __init__

# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import __init__ [as 别名]
	def __init__(self, parent, n):
		Frame.__init__(self, parent)
		self.parent = parent;
		self.parent.maxsize(1200,720)
		self.parent.minsize(1200,720)
		self.initUI()
		self.placeWindow(n)
开发者ID:urrfinjuss,项目名称:gas-network,代码行数:9,代码来源:gas.py

示例14: __init__

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

        self.parent = parent

        self.parent.title("Test title")
        self.fullscreen()
开发者ID:tiborv,项目名称:tdt4140-swag,代码行数:9,代码来源:tkintertest.py

示例15: __init__

# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import __init__ [as 别名]
    def __init__(self, master=None):
        # Avoiding to send it continuously.
        self.lock = False

        Frame.__init__(self, master)
        self.grid()
        self.master = master
        # Setting for ComboBox.
        self.url_lang_combobox_str = StringVar()
        self.url_lang_combobox_list = lang_list
        # UI components.
        self.receiver_email_text = Label(self, text="Receiver:")
        self.receiver_email_field = Entry(self, width=50)
        self.subject_text = Label(self, text='Subject:')
        self.subject_field = Entry(self, width=50)
        self.receiver_name_text = Label(self, text='Name:')
        self.receiver_name_field = Entry(self, width=50)
        self.url_lang_text = Label(self, text='Link lang:')
        self.url_lang_combobox = Combobox(self, textvariable=self.url_lang_combobox_str, values=self.url_lang_combobox_list, state='readonly')
        self.send_progressbar = Progressbar(self, orient='horizontal', length=500, mode='determinate', maximum=300)
        self.send_button = Button(self, text='Send', command=self._send_mail)
        self.quit_button = Button(self, text='Exit', command=self.__exit)
        self.log_msg_text = ScrolledText(self)
        # Attachment.
        self.mail_attachment_list = attachment_list[:]
        self.url_lang_link_title = None
        self.url_lang_link = copy.deepcopy(content_link)
        # Mailer
        self._mailer = None

        # Let Mailer can control components.
        Mailer.window_content = self

        self.__create_widgets()
开发者ID:pokk,项目名称:Mailer,代码行数:36,代码来源:auto_mailer.py


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