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


Python LabelFrame.columnconfigure方法代码示例

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


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

示例1: _init_components

# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import columnconfigure [as 别名]
    def _init_components(self):
        self._panes = PanedWindow(self, orient='horizontal', sashrelief="raised")
        self._panes.pack(expand=True, fill='both')

        self._left_pane = Frame(self._panes, padx=10, pady=5)
        self._right_pane = PanedWindow(self._panes)
        self._panes.add(self._left_pane, sticky='n')
        self._panes.add(self._right_pane)

        self._group_select = GroupSelect(self._left_pane)
        self._group_select.pack(expand=True, fill='x')

        # spacer
        Frame(self._left_pane, height=10).pack()

        graph_controls = LabelFrame(self._left_pane, text="Graph options", padx=10, pady=5)
        graph_controls.columnconfigure(1, weight=1)
        graph_controls.pack(expand=True, fill='x')

        self._show_graph_checkbutton = CheckBox(graph_controls, text='Show graph')
        self._show_graph_checkbutton.select()
        self._show_graph_checkbutton.grid(row=0, columnspan=2, sticky='w')

        Label(graph_controls, text='Algorithm').grid(row=1, sticky='w')
        self._graph_type = OptionList(graph_controls, values=MainWindow.GRAPH_TYPES.keys())
        self._graph_type.config(width=15)
        self._graph_type.grid(row=1, column=1, sticky='we')

        # spacer
        Frame(self._left_pane, height=10).pack()

        self._go_button = Button(self._left_pane, text='Go', command=self._go)
        self._go_button.pack()
开发者ID:aikoven,项目名称:calculations,代码行数:35,代码来源:main_window.py

示例2: show

# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import columnconfigure [as 别名]
    def show(self):
        self.__root.title(CONST.APP_NAME)
        mainFrame = Frame(self.__root)
        # Configure main frame and make Dialog stretchable (to EAST and WEST)
        top = mainFrame.winfo_toplevel()
        top.rowconfigure(0, weight=1)
        top.columnconfigure(0, weight=1)
        mainFrame.rowconfigure(0, weight=1)
        mainFrame.columnconfigure(0, weight=1)
        mainFrame.grid(sticky='ew')

        # Configure the frames to hold the controls
        # - Frame with input settings
        inputFrame = LabelFrame(mainFrame, text='Input Settings')
        inputFrame.columnconfigure(1, weight=1)
        inputFrame.grid(column=0, row=0, padx=5, pady=5, sticky='ew')
        # - Frame with output settings
        outputFrame = LabelFrame(mainFrame, text='Output Settings')
        outputFrame.columnconfigure(1, weight=1)
        outputFrame.grid(column=0, row=1, padx=5, pady=5, sticky='ew')
        # - Frame with buttons at the bottom of the dialog
        buttonFrame = Frame(mainFrame)
        buttonFrame.grid(column=0, row=2, padx=5, pady=5, sticky='e')

        # Controls for input
        dataSourceFileLabel = Label(inputFrame, text='Data File:', width=15, anchor='w')
        dataSourceFileLabel.grid(column=0, row=1, padx=5, pady=5, sticky='w')
        dataSourceFileEntry = Entry(inputFrame, width=70, textvariable=self.__ctrl.getDataSourceFileEntryVariable())
        dataSourceFileEntry.grid(column=1, row=1, padx=5, pady=5, sticky='ew')
        dataSourceFileButton = Button(inputFrame, text='...', command=self.__ctrl.dataSourceFileEntryVariableHandler)
        dataSourceFileButton.grid(column=2, row=1, padx=5, pady=5, sticky='e')

        # Controls for output
        numberOfDataLinesToMergeLabel = Label(outputFrame, text='Number of rows to merge into this document:', width=35, anchor='w')
        numberOfDataLinesToMergeLabel.grid(column=0, row=2, padx=5, pady=5, sticky='w')
        # numberOfDataLinesToMergeListBox = OptionMenu(outputFrame, self.__ctrl.getSelectedNumberOfLines(), tuple(self.__ctrl.getNumerOfLinesList())) # TODO: implement these two functions in the controller
        numberOfDataLinesToMergeListBox = apply(OptionMenu, (outputFrame, self.__ctrl.getSelectedNumberOfLines()) + tuple(self.__ctrl.getNumerOfLinesList()))
        numberOfDataLinesToMergeListBox.grid(column=1, row=2, padx=5, pady=5, sticky='w')

        # Buttons
        cancelButton = Button(buttonFrame, text='Cancel', width=10, command=self.__ctrl.buttonCancelHandler)
        cancelButton.grid(column=1, row=0, padx=5, pady=5, sticky='e')
        runButton = Button(buttonFrame, text='Run', width=10, command=self.__ctrl.buttonOkHandler)
        runButton.grid(column=2, row=0, padx=5, pady=5, sticky='e')

        # Show the dialog
        mainFrame.grid()
        self.__root.grid()
        self.__root.mainloop()
开发者ID:bjarnesvanberg,项目名称:Scribus-Data-Merger,代码行数:51,代码来源:ScribusDataMerger.py

示例3: Editor

# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import columnconfigure [as 别名]
class Editor(object):

    """
    Finestra per l'editor di condice assembly
    """

    def __init__(self, master, calcolatore):
        """
        Inizializza i frame della finestra dell'Editor
        """
        self.master = master
        self.CD = calcolatore
        # Codice Assembly
        self.codice = LabelFrame(
            self.master, text='Codice Assembly', relief=RIDGE, borderwidth=5, labelanchor='n', pady=5)
        self.codice.rowconfigure(0, weight=1)
        self.codice.columnconfigure(0, weight=1)
        self.codice.grid(
            row=1, column=0, rowspan=3, columnspan=5, sticky=W + E + N + S)

        self.menubar = Menu(self.master)
        self.create_widgets(self.menubar)

    def create_widgets(self, menubar):
        """
        Crea il layout del programma, finestra dell'Editor
        """
        # Menu
        self.filemenu = Menu(menubar, tearoff=0)
        self.filemenu.add_command(label='Apri', command=self.aprifile)
        self.filemenu.add_command(label='Salva', command=self.salvafile)
        self.filemenu.add_command(label='Cancella', command=self.cancella)
        self.filemenu.add_separator()
        self.filemenu.add_command(label='Esci', command=self.exit)
        menubar.add_cascade(label='Opzioni', menu=self.filemenu)
        self.master.config(menu=self.menubar)

        self.helpmenu = Menu(menubar, tearoff=0)
        self.helpmenu.add_command(label='Informazioni', command=self.infor)
        self.helpmenu.add_command(label='Legenda', command=self.leg)
        self.helpmenu.add_command(label='Guida', command=self.guida)
        menubar.add_cascade(label='Aiuto', menu=self.helpmenu)

        # Codice Assembly
        self.Inserisci = Text(self.codice, width=50, height=30, wrap=WORD)
        self.Inserisciscrollbar = Scrollbar(self.codice)
        self.Inserisciscrollbar.config(command=self.Inserisci.yview)
        self.Inserisci.config(yscrollcommand=self.Inserisciscrollbar.set)
        self.Inserisciscrollbar.grid(row=0, column=1, sticky=N + S)
        self.Inserisci.grid(row=0, column=0, sticky=W)

    def exit(self):
        """
        Esce dal programma
        """
        if askquestion('Exit', 'Sicuro di voler uscire?') == YES:
            self.master.quit()
            self.master.destroy()
        else:
            showinfo(
                'Suggerimento', """Forse e' meglio fare una pausa!""", icon=WARNING)

    def aprifile(self):
        """
        Apre un file assembly e lo mostra a video per essere modificato
        """
        path = askopenfilename(title='Apri codice assembly',
                               filetypes=[('Assembly', '.asm'), ('Testo', '.txt'), ('All', '*')])
        if path != '':
            file = open(path, 'r')
            temp = file.read()
            self.Inserisci.delete(1.0, END)
            self.Inserisci.insert(INSERT, temp.decode('ascii', 'ignore'))
            file.close()

    def cancella(self):
        """
        Cancella l'attuale file assembly caricato
        """
        if askquestion('Cancella', 'Si vuole cancellare tutto il codice assembly?') == YES:
            self.Inserisci.delete(1.0, END)

    def salvafile(self):
        """
        Salva il file assembly su cui si sta lavorando
        """
        contenuto = self.Inserisci.get(1.0, END)
        contenuto = contenuto.encode('ascii', 'ignore')
        path = asksaveasfilename(title='Salva codice assembly',
                                 defaultextension=[
                                     ('Assembly', '.asm'), ('Testo', '.txt'), ('All', '*')],
                                 filetypes=[('Assembly', '.asm'), ('Testo', '.txt'), ('All', '*')])

        print path
        if path != '':
            file = open(path, 'w')
            file.write(str(contenuto))
            file.close()

    @staticmethod
#.........这里部分代码省略.........
开发者ID:Mappo23,项目名称:py-pdp8-tk,代码行数:103,代码来源:Editor.py

示例4: show

# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import columnconfigure [as 别名]
    def show(self):
        self.__root.title(CONST.APP_NAME)
        mainFrame = Frame(self.__root)
        # Make Dialog stretchable (to EAST and WEST)
        top = mainFrame.winfo_toplevel()
        top.rowconfigure(0, weight=1)
        top.columnconfigure(0, weight=1)
        mainFrame.rowconfigure(0, weight=1)
        mainFrame.columnconfigure(0, weight=1)
        mainFrame.grid(sticky='ew')

        # Three Sections: Input-Settings, Output-Settings and Buttons
        inputFrame = LabelFrame(mainFrame, text='Input Settings')
        inputFrame.columnconfigure(1, weight=1)
        inputFrame.grid(column=0, row=0, padx=5, pady=5, sticky='ew')
        outputFrame = LabelFrame(mainFrame, text='Output Settings')
        outputFrame.columnconfigure(1, weight=1)
        outputFrame.grid(column=0, row=1, padx=5, pady=5, sticky='ew')
        buttonFrame = Frame(mainFrame)
        buttonFrame.grid(column=0, row=2, padx=5, pady=5, sticky='e')

        # Input-Settings
        scribusSourceFileLabel = Label(inputFrame, text='Scribus File:', width=15, anchor='w')
        scribusSourceFileLabel.grid(column=0, row=0, padx=5, pady=5, sticky='w')
        scribusSourceFileEntry = Entry(inputFrame, width=70, textvariable=self.__ctrl.getScribusSourceFileEntryVariable())
        scribusSourceFileEntry.grid(column=1, row=0, padx=5, pady=5, sticky='ew')
        scribusSourceFileButton = Button(inputFrame, text='...', command=self.__ctrl.scribusSourceFileEntryVariableHandler)
        scribusSourceFileButton.grid(column=2, row=0, padx=5, pady=5, sticky='e')

        dataSourceFileLabel = Label(inputFrame, text='Data File:', width=15, anchor='w')
        dataSourceFileLabel.grid(column=0, row=1, padx=5, pady=5, sticky='w')
        dataSourceFileEntry = Entry(inputFrame, width=70, textvariable=self.__ctrl.getDataSourceFileEntryVariable())
        dataSourceFileEntry.grid(column=1, row=1, padx=5, pady=5, sticky='ew')
        dataSourceFileButton = Button(inputFrame, text='...', command=self.__ctrl.dataSourceFileEntryVariableHandler)
        dataSourceFileButton.grid(column=2, row=1, padx=5, pady=5, sticky='e')

        # Output-Settings
        outputDirectoryLabel = Label(outputFrame, text='Output Directory:', width=15, anchor='w')
        outputDirectoryLabel.grid(column=0, row=0, padx=5, pady=5, sticky='w')
        outputDirectoryEntry = Entry(outputFrame, width=70, textvariable=self.__ctrl.getOutputDirectoryEntryVariable())
        outputDirectoryEntry.grid(column=1, row=0, padx=5, pady=5, sticky='ew')
        outputDirectoryButton = Button(outputFrame, text='...', command=self.__ctrl.outputDirectoryEntryVariableHandler)
        outputDirectoryButton.grid(column=2, row=0, padx=5, pady=5, sticky='e')

        outputFileNameLabel = Label(outputFrame, text='Output File Name:', width=15, anchor='w')
        outputFileNameLabel.grid(column=0, row=1, padx=5, pady=5, sticky='w')
        outputFileNameEntry = Entry(outputFrame, width=70, textvariable=self.__ctrl.getOutputFileNameEntryVariable())
        outputFileNameEntry.grid(column=1, row=1, padx=5, pady=5, sticky='ew')

        outputFormatLabel = Label(outputFrame, text='Output Format:', width=15, anchor='w')
        outputFormatLabel.grid(column=0, row=2, padx=5, pady=5, sticky='w')
        outputFormatListBox = OptionMenu(outputFrame, self.__ctrl.getSelectedOutputFormat(), self.__ctrl.getOutputFormatList())
        outputFormatListBox.grid(column=1, row=2, padx=5, pady=5, sticky='w')

        keepGeneratedScribusFilesLabel = Label(outputFrame, text='Keep Scribus Files:', width=15, anchor='w')
        keepGeneratedScribusFilesLabel.grid(column=0, row=3, padx=5, pady=5, sticky='w')
        keepGeneratedScribusFilesCheckbox = Checkbutton(outputFrame, variable=self.__ctrl.getKeepGeneratedScribusFilesCheckboxVariable())
        keepGeneratedScribusFilesCheckbox.grid(column=1, row=3, padx=5, pady=5, sticky='w')

        # Buttons to Cancel or to Run the Generator with the given Settings
        helpButton = Button(buttonFrame, text='Help', width=10, command=self.__ctrl.helpButtonHandler)
        helpButton.grid(column=0, row=0, padx=5, pady=5, sticky='e')
        cancelButton = Button(buttonFrame, text='Cancel', width=10, command=self.__ctrl.buttonCancelHandler)
        cancelButton.grid(column=1, row=0, padx=5, pady=5, sticky='e')
        generateButton = Button(buttonFrame, text='Generate', width=10, command=self.__ctrl.buttonOkHandler)
        generateButton.grid(column=2, row=0, padx=5, pady=5, sticky='e')

        # Finally show the Generator Dialog
        mainFrame.grid()
        self.__root.grid()
        self.__root.mainloop()
开发者ID:rozzilla,项目名称:crea-tabella,代码行数:73,代码来源:ScribusGenerator.py


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