• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python ttk.Notebook类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中ttk.Notebook的典型用法代码示例。如果您正苦于以下问题:Python Notebook类的具体用法?Python Notebook怎么用?Python Notebook使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: __init__

    def __init__(self, parent, user):
        Notebook.__init__(self, parent)

        self.pack(fill=BOTH, expand=1)

        for wid, workspace in user.workspaces.iteritems():
            widget = WorkspaceWidget(self, workspace)
            self.add(widget, text=workspace.name)

        checkIdleThread = IdleChecker(user)
        checkIdleThread.start()
开发者ID:ramblex,项目名称:lite-toggl,代码行数:11,代码来源:app_widget.py


示例2: _create_panel

 def _create_panel(self):
     
     panel = Frame(self, name='elastic')
     #panel.pack(side=TOP, fill=BOTH, expand=Y)
     panel.grid(row=0, column=0, sticky=NSEW) 
     nb = Notebook(panel, name='notebook')
     
     nb.enable_traversal()
     #nb.pack(fill=BOTH, expand=Y, padx=2, pady=3)
     nb.grid(row=0, column=0, sticky=NSEW)
     self._create_setup_tab(nb)
     self._create_analyze_tab(nb)
开发者ID:tdengg,项目名称:pylastic,代码行数:12,代码来源:main.py


示例3: __init__

 def __init__(self):
     self.parent = Tkinter.Tk()
     Notebook.__init__(self, self.parent)
     # self.parent.title('Quora Analytics')
     self.parent.title("Quora Backup and Analytics")
     self.parent.wm_title("Quora Backup and Analytics")
     self.parent.grid_rowconfigure(0, weight=1)
     self.parent.grid_columnconfigure(0, weight=1)
     self.parent.resizable(True, True)
     self.grid_rowconfigure(0, weight=1)
     self.grid_columnconfigure(0, weight=1)
     self.crawler = QuoraCrawler(driver=QuoraCrawler.CHROME_DRIVER)
     self._add_frames()
     self.pack(fill="both", expand=True)
开发者ID:Alafazam,项目名称:quora-analytics,代码行数:14,代码来源:main.py


示例4: __init__

    def __init__(self, master, page_names=None, **kw):
        """Constructor arguments:

        page_names -- A list of strings, each will be the dictionary key to a
        page's widget, and the name displayed on the page's tab. Should be
        specified in the desired page order. The first page will be the default
        and first active page. If page_names is None or empty, the
        TabbedPageSet will be initialized empty.
        """
        Notebook.__init__(self, master, **kw)

        self.pages = {}
        page_names = page_names or ()
        for name in page_names:
            self.add_page(name)
开发者ID:8848,项目名称:Pymol-script-repo,代码行数:15,代码来源:tabbedpages_new.py


示例5: _setup_file_lists

    def _setup_file_lists(self):

        self.file_notebook = Notebook(self.content, padding=(0, 5, 0, 5))
        self.content.add(self.file_notebook)

        self._setup_stack_frame_list()
        self._setup_breakpoint_list()
开发者ID:adamchainz,项目名称:bugjar,代码行数:7,代码来源:view.py


示例6: initUI

    def initUI(self):
        self.parent.title("Test")
        self.frameTab = Frame(self, relief=RAISED, borderwidth=1)
        self.frameTab.grid(row=3, column=0, columnspan=4)
        self.grid(row=0, column=0)
        self.frameTab.grid(row=0, column=0)
        self.note_book = Notebook(self.frameTab)
        self.specific_actions = ActionModulation.ActionModulation(self.note_book)
        self.note_book.add(self.specific_actions.getFrame(), text="specific actions")
        self.general_actions = GeneralActionModulation.GeneralActionModulation(self.note_book)
        self.note_book.add(self.general_actions.getFrame(), text="general actions")
        self.note_book.grid(row=0, column=0)

        self.frameButtons = Frame(self, relief=RAISED, borderwidth=1)
        self.frameButtons.grid(row=3, column=0, columnspan=4)
        self.buttonReset = Button(self.frameButtons, text="Reset")
        self.buttonReset.grid(row=0, column=0)
        self.buttonAbort = Button(self.frameButtons, text="Abort")
        self.buttonAbort.grid(row=0, column=1)
        self.buttonStop = Button(self.frameButtons, text="Stop")
        self.buttonStop.grid(row=0, column=2)
        self.buttonSendAction = Button(self.frameButtons, text="Send Action")
        self.buttonSendAction.grid(row=0, column=4)
        self.buttonSendEmotion = Button(self.frameButtons, text="Send Emotion")
        self.buttonSendEmotion.grid(row=0, column=5)
开发者ID:julianangel,项目名称:EmotionBot,代码行数:25,代码来源:NewActionModulation.py


示例7: __init__

    def __init__(self, master):
        master.minsize(width=1500, height=1500)
        root = Frame(master)
        root.pack(side=TOP, fill=BOTH)
        master.title('Stocks evaluation - Sandeep Joshi (FE520)')

        n = Notebook(root)
        n.enable_traversal()
        n.pack(fill=BOTH)
        self._create_stat_tab(n)
        self._create_help_tab(n)
        self.data = {}
        self.start = ''
        self.end = ''
        self.tickers = []
        self.tree
开发者ID:Sandeep-Joshi,项目名称:stocks-comparison,代码行数:16,代码来源:Project.py


示例8: NewActionModulation

class NewActionModulation(Frame):
    def __init__(self, parent):
        Frame.__init__(self, parent)
        self.parent = parent
        self.initUI()

    def initUI(self):
        self.parent.title("Test")
        self.frameTab = Frame(self, relief=RAISED, borderwidth=1)
        self.frameTab.grid(row=3, column=0, columnspan=4)
        self.grid(row=0, column=0)
        self.frameTab.grid(row=0, column=0)
        self.note_book = Notebook(self.frameTab)
        self.specific_actions = ActionModulation.ActionModulation(self.note_book)
        self.note_book.add(self.specific_actions.getFrame(), text="specific actions")
        self.general_actions = GeneralActionModulation.GeneralActionModulation(self.note_book)
        self.note_book.add(self.general_actions.getFrame(), text="general actions")
        self.note_book.grid(row=0, column=0)

        self.frameButtons = Frame(self, relief=RAISED, borderwidth=1)
        self.frameButtons.grid(row=3, column=0, columnspan=4)
        self.buttonReset = Button(self.frameButtons, text="Reset")
        self.buttonReset.grid(row=0, column=0)
        self.buttonAbort = Button(self.frameButtons, text="Abort")
        self.buttonAbort.grid(row=0, column=1)
        self.buttonStop = Button(self.frameButtons, text="Stop")
        self.buttonStop.grid(row=0, column=2)
        self.buttonSendAction = Button(self.frameButtons, text="Send Action")
        self.buttonSendAction.grid(row=0, column=4)
        self.buttonSendEmotion = Button(self.frameButtons, text="Send Emotion")
        self.buttonSendEmotion.grid(row=0, column=5)

    def getCurrentTab(self):
        return self.note_book.index(self.note_book.select())

    def getFirstTab(self):
        return self.specific_actions

    def getSecondTab(self):
        return self.general_actions

    def getButtonSendAction(self):
        return self.buttonSendAction

    def getButtonSendEmotion(self):
        return self.buttonSendEmotion

    def getButtonReset(self):
        return self.buttonReset

    def getButtonAbort(self):
        return self.buttonAbort

    def getButtonStop(self):
        return self.buttonStop
开发者ID:julianangel,项目名称:EmotionBot,代码行数:55,代码来源:NewActionModulation.py


示例9: _SetupCanvas

 def _SetupCanvas(self):
     '''
     '''
     self.figure = Figure()
     self.figure.subplots_adjust(left=0.15, bottom=0.2)
     self.subfigure = self.figure.add_subplot(1,1,1)
     self.notebook = Notebook(self.toplevel)
     self.notebook.grid(row=1, column=1, rowspan=3, columnspan=3, sticky='nsew')
     self.canvas = FigureCanvasTkAgg(self.figure, master=self.toplevel)
     self.canvas.show()
     self.canvas.get_tk_widget().grid(row=0, column=0, rowspan=10)
开发者ID:project8,项目名称:Pypeline,代码行数:11,代码来源:channel_plot.py


示例10: init_UI

def init_UI():
	'''create tabs and required content'''

	# initialize main window
	main = Tk()
	main.title('data2knowledge')

	# component for 'tab' functionality
	n = Notebook(main)

	# initialize the various tabs
	EnrichTab(n, 'Enrich', main)
	ProcessTab(n, 'Process', main)
	MergeTab(n, 'Merge', main)
	LearningTab(n, 'Learn', main)
	ReportTab(n, 'Report', main)
	AboutTab(n, 'About', main)

	# finish up, return UI
	n.pack()
	return main
开发者ID:MarkMenagie,项目名称:EMR-pre-processing-pipeline,代码行数:21,代码来源:main.py


示例11: __init__

class Tabs:
	def __init__(self, parent):
		self.root = Notebook(parent)
		self.frames = {}
		# self.frame1 = Frame(self.root)
		# self.root.add(self.frame1, text=label1)

		# self.frame2 = Frame(self.root)
		# self.root.add(self.frame2, text=label2)

		# self.frame3 = Frame(self.root)
		# self.root.add(self.frame3, text=label3)


	def add_frame(self, frame, label):
		# self.frames.append(frame)
		self.root.add(frame, text=label)
		self.frames[label] = frame

	def get_root(self):
		return self.root
开发者ID:wherts,项目名称:smartShop,代码行数:21,代码来源:tablayout.py


示例12: init_ui

    def init_ui(self):
        #make resizable
        self.grid_columnconfigure(0, weight=1)
        self.grid_rowconfigure(0, weight=1)

        self.notebook = Notebook(self)
        # define mainapp instance -- also manages above telemetry thread
        self.mainApplication = MainApplication(self, self.client_queue_cmd, self.client_queue_log, self.client_queue_telem, self.beam_gap_queue, self.destroyEvent, self.server_ip) 
        self.notebook.add(self.mainApplication, text = "Main")
        # define telemetry widgets
        self.monitor = Monitor(self, VisualConstants.MARS_PRIMARY(1))
        self.notebook.add(self.monitor, text = 'Monitor')
        self.notebook.grid(column = 0, row = 0, sticky = 'nsew')
        
        # menu -outside of notebook
        self.menu_ = TopMenu(self, '../gui/operations.json', self.client_queue_cmd, 'Commands')
        ### Add custom commands here
        self.menu_.add_menu_item('Reconnect to Cameras', self.mainApplication.start_streams, "View")
        self.menu_.add_menu_item('Left', self.mainApplication.focus_left, 'View/Camera Focus')
        self.menu_.add_menu_item('Center', self.mainApplication.focus_center, 'View/Camera Focus')
        self.menu_.add_menu_item('Right', self.mainApplication.focus_right, 'View/Camera Focus')
        self.menu_.add_menu_item('IBeam Display', self.beamGapGraph, 'View/Windows')
        self.menu_.add_menu_item('Toggle FOD Enabled', self.mainApplication.toggle_fod, 'View/Object Detection')
        self.menu_.add_menu_item('Set Ideal Images', self.mainApplication.define_ideal_images, 'View/Object Detection')
        ### 
        self.menu_.finalize_menu_items()
        self.config(menu=self.menu_)
        
        # start all operations here so we don't cause a hissyfit between tkinter and threads
        self.mainApplication.start_streams()
        #define telemetryThread
        self.tthread = TelemetryThread([self.mainApplication.telemetry_w, self.monitor], self.client_queue_telem, self.beam_gap_queue)
        self.tthread.start()

        # title and icon
        self.wm_title('Hyperloop Imaging Team')
        #this is garbage, i hate tkinter
        #self.img = ImageTk.PhotoImage(file='rit_imaging_team.xbm')
        #self.tk.call('wm', 'iconphoto', self._w, self.img)
        #self.iconbitmap('@rit_imaging_team.xbm')
        #call destroyCallback on clicking X
        self.protocol('WM_DELETE_WINDOW', self.destroyCallback)
        

        #assign dimensions and locatin on screen
        width = 900
        height = 500
 
        x = (self.winfo_screenwidth() // 2) - (width // 2)
        y = (self.winfo_screenheight() // 2) - (height // 2)
        self.geometry('{}x{}+{}+{}'.format(width, height, x, y))
        
        self.update()
开发者ID:JoeBartelmo,项目名称:PyDetect,代码行数:53,代码来源:gui.py


示例13: show_control

def show_control(master, data):
    """Выводит блокнот управления с пятью закладками"""

    if data.is_restart:
        reload(control_a)
        reload(control_b)
        reload(control_c)
        reload(control_d)
        reload(control_e)
        reload(control_f)

    from control_a import show_goods
    from control_b import show_calc
    from control_c import show_sales_goods
    from control_d import show_sales
    from control_e import show_others
    from control_f import show_plus


    def tab_changes(tab):
        """функция, срабатывающая при нажатии закладок переключения
        между правыми (основными) фреймами"""

        window_names = controlTabs.tabs()
        index = window_names.index(controlTabs.select())

        if not FLAGS[index]:
            CONTROL[index](workArea[index], data)                   #нужна ли эта дата?
            FLAGS[index] = True
        else:
            CONTROL[index].renew()


    CONTROL = (show_goods, show_calc, show_sales_goods,
               show_sales, show_others, show_plus)

    FLAGS = [False, False, False, False, False, False]

    heads = (u' Товары ', u' Калькуляции ',
             u' Акционные товары ', u' Акционные цены ',
             u' Категории, скидки, причины списания ', u' Дополнительно ')

    workArea = []

    controlTabs = Notebook(master)
    for q in range (6):
        frame = Canvas(controlTabs, relief=GROOVE, highlightthickness=0)
        if USE_BACKGROUND:
            frame.create_image(0,0, anchor='nw', image=data.photo)
        controlTabs.add(frame, text=heads[q])
        workArea.append(frame)
    controlTabs.pack(side=TOP, fill=BOTH, expand=YES)
    controlTabs.bind('<<NotebookTabChanged>>', tab_changes)
    Style().configure("TNotebook.Tab", font=('Verdana', FONT_SIZE))
开发者ID:sychov,项目名称:conditer,代码行数:54,代码来源:control.py


示例14: __init__

    def __init__(self, root):
        # 数据载入和分类器训练
        bc_dataset = BreastCancerDataSet()
        bc_x_train = bc_dataset.x_train
        bc_y_train = bc_dataset.y_train
        bc_x_test = bc_dataset.x_test
        bc_y_test = bc_dataset.y_test

        ctg_dataset = CardiotocographyDataSet()
        ctg_x_train = ctg_dataset.x_train
        ctg_y_train = ctg_dataset.y_train
        ctg_x_test = ctg_dataset.x_test
        ctg_y_test = ctg_dataset.y_test

        # 初始化UI
        menubar = Tk.Menu(root)  # 添加菜单
        root.config(menu=menubar)
        filemenu = Tk.Menu(menubar)
        filemenu.add_command(label="Exit", command=sys.exit)
        menubar.add_cascade(label="File", menu=filemenu)

        notebook = Notebook(root)  # 添加标签页
        notebook.pack(fill=Tk.BOTH)

        page_0 = Tk.Frame(notebook)
        notebook.add(page_0, text="Main  ")
        notebook_0 = Notebook(page_0)  # 添加子标签页
        notebook_0.pack(fill=Tk.BOTH)
        page_01 = Tk.Frame(notebook_0)
        notebook_0.add(page_01, text="Breast Cancer")
        page_02 = Tk.Frame(notebook_0)
        notebook_0.add(page_02, text="Cardiotocography")
        page_05 = Tk.Frame(notebook_0)
        notebook_0.add(page_05, text="Cardiotocography Features Rank")
        page_04 = Tk.Frame(notebook_0)
        notebook_0.add(page_04, text="Cardiotocography Features Corr")
        page_03 = Tk.Frame(notebook_0)
        notebook_0.add(page_03, text="Cardiotocography Features Pair")
        page_06 = Tk.Frame(notebook_0)
        notebook_0.add(page_06, text="Console Output")

        page_1 = Tk.Frame(notebook)
        notebook.add(page_1, text="Training  ")
        notebook_1 = Notebook(page_1)  # 添加子标签页
        notebook_1.pack(fill=Tk.BOTH)
        page_11 = Tk.Frame(notebook_1)
        notebook_1.add(page_11, text="LR")
        page_12 = Tk.Frame(notebook_1)
        notebook_1.add(page_12, text="SVM")
        page_13 = Tk.Frame(notebook_1)
        notebook_1.add(page_13, text="RF")

        page_2 = Tk.Frame(notebook)
        notebook.add(page_2, text="Testing  ")
        subnotebook_2 = Notebook(page_2)  # 添加子标签页
        subnotebook_2.pack(fill=Tk.BOTH)
        page_21 = Tk.Frame(subnotebook_2)
        subnotebook_2.add(page_21, text="LR")
        page_22 = Tk.Frame(subnotebook_2)
        subnotebook_2.add(page_22, text="SVM")
        page_23 = Tk.Frame(subnotebook_2)
        subnotebook_2.add(page_23, text="RF")

        page_3 = Tk.Frame(notebook)
        notebook.add(page_3, text="Learning Curve")

        page_4 = Tk.Frame(notebook)
        notebook.add(page_4, text="Validation Curve")

        page_5 = Tk.Frame(notebook)
        notebook.add(page_5, text="ROC & AUC")

        page_6 = Tk.Frame(notebook)
        notebook.add(page_6, text="GridSearchCV")

        page_7 = Tk.Frame(notebook)
        notebook.add(page_7, text="t-SNE")

        # 第0页 主页

        console = ConsoleFrame(page_06)
        console.pack(fill=Tk.BOTH)

        bc_eva = Evaluator(scaler=StandardScaler(), pca=PCA(n_components=2), clf=SVC(probability=True, random_state=1))
        BreastCancerMainFrame(page_01, bc_x_train, bc_y_train, bc_x_test, bc_y_test, bc_eva, console).pack(fill=Tk.BOTH)

        ctg_eva = Evaluator(scaler=StandardScaler(), pca=PCA(n_components=2), clf=SVC(probability=True, random_state=1))
        CardiotocographyMainFrame(page_02, ctg_x_train, ctg_y_train, ctg_x_test, ctg_y_test, ctg_eva, console).pack(fill=Tk.BOTH)

        FeaturesPairFrame(page_03, ctg_x_train, ctg_y_train, ctg_x_test, ctg_y_test, ctg_eva, ctg_dataset.df, console).pack(
            fill=Tk.BOTH)

        FeaturesCorrFrame(page_04, ctg_x_train, ctg_y_train, ctg_x_test, ctg_y_test, ctg_eva, ctg_dataset.df, console).pack(
            fill=Tk.BOTH)

        FeaturesRankFrame(page_05, ctg_x_train, ctg_y_train, ctg_x_test, ctg_y_test, ctg_eva, ctg_dataset.df, console).pack(
            fill=Tk.BOTH)
开发者ID:vincent2610,项目名称:cancer-assessment,代码行数:97,代码来源:main.py


示例15: show_sell_bills


#.........这里部分代码省略.........
                index = window_names.index(w_name) - 1
                note.select(window_names[index])

        button_left = Button(sellTopFrame, image=data.IMG_INTERFACE[3],
                                command=b_left)
        button_left.pack(side=LEFT, padx=5, pady=5)

        #------------------------------------------------------------
        def b_right():
            """Срабатывает при нажатии кнопки "вправо", сдвигается вправо на
            один таб в блокноте со счетами"""

            w_name = note.select()
            window_names = note.tabs()
            if window_names:
                index = window_names.index(w_name) + 1
                if index == len(window_names):
                    index = 0
                note.select(window_names[index])

        button_right = Button(sellTopFrame, image=data.IMG_INTERFACE[4],
                                command=b_right)
        button_right.pack(side=LEFT, padx=5, pady=5)

        #------------------------------------------------------------
        def b_del():
            """Срабатывает при нажатии кнопки "удалить счет", удаляет таб в
            блокноте со счетами"""

            w_name = note.select()
            window_names = note.tabs()
            if not window_names:
                button_del_bill.configure(state=DISABLED)
            else:
                index = window_names.index(w_name)
                if not bills[index].bill:
                    note.forget(note.select())
                    del(bills[index])
                    if not note.tabs():
                        button_del_bill.configure(state=DISABLED)
                else:
                    if tkMessageBox.askokcancel('Внимание!',
                                   'Вы уверены, что хотите удалить этот счет?'):
                        note.forget(note.select())
                        del(bills[index])
                        if not note.tabs():
                            button_del_bill.configure(state=DISABLED)

        button_del_bill = Button(sellTopFrame,text=u'Удалить\nсчет',
                        style='Little.TButton', command=b_del)
        button_del_bill.pack(side=LEFT, padx=10, pady=10, fill=X)


        #----- ОСТАВШИЕСЯ ЭЛЕМЕНТЫ - БЛОКНОТ, СЧЕТЧИК ПРОДАЖ, КАЛЬКУЛЯТОР ------

        label = Label(sellTopFrame, text='', bg='white',
                                            font=('Lucida Console', FONT_SIZE))
        label.pack(side=RIGHT, padx=10, pady=5)

        def label_renew():
            """Обновляет счетчик продаж в верхнем правом углу экрана"""
            sold = '%6.2f' % round(queries.sell_in_day(),2) + ' грн.'
            label.configure(text='СЕГОДНЯ ПРОДАНО\n на ' + sold)

        label_renew()
        show_sell_bills.label_renew = label_renew

        #-----------
        button_calc = Button(sellTopFrame, image=data.IMG_INTERFACE[8],
                        command=calculator_press)
        button_calc.pack(side=RIGHT, padx=5, pady=5)

        button_paid = Button(sellTopFrame, image=data.IMG_INTERFACE[10], width=8,
                                     compound=LEFT, text=u'Блокнот\nрасходов',
                                     command=lambda: calc_pad(data))
        button_paid.pack(side=RIGHT, padx=5, pady=5)

        #-----------
        note = Notebook(master, style='Custom.TNotebook')
        bills = []
        note.pack(side=TOP, padx=BILL_PAD_X, pady=BILL_PAD_Y)

        #----------- Один пустой столик ставим по умолчанию ----------
        bill = Bill(note)
        bills.append(bill)
        tab = bill.frame
        note.add(tab, text = u' Стол 1 ')
        #-------------------------------------------------------------

        #--------Автоподъем высоты ------------
        sellTopFrame.update()
        y1 = sellTopFrame.winfo_height()
        y2 = note.winfo_height()
        master.configure(height = y1 + y2 + 40)
        master.pack_propagate(False)
        #---------------------------------------

        calculator_press.window_calc = False

        return bills, note
开发者ID:sychov,项目名称:conditer,代码行数:101,代码来源:sell.py


示例16: __init__

    def __init__(self, master):
        Frame.__init__(self, master)
        self.FileObjects = []
        self.FileObjectNames = []
        self.intSettings = {'Group': IntVar(value=1),
                            'DataObject': IntVar(value=1),
                            'FieldVariables': IntVar(value=1)}

        self.FieldVariables = OrderedDict()

        self.notebook = Notebook(self)
        self.tab1 = Frame(self.notebook)
        self.tab2 = Frame(self.notebook)
        self.notebook.add(self.tab1, text="Data Interaction")
        self.notebook.add(self.tab2, text="Mach-1 Image Grid")
        self.notebook.grid(row=0, column=0, sticky=NW)

        #####  BEGIN TAB 1 #####
        self.frameDataFiles = Frame(self.tab1)
        self.frameDataFiles.grid(row=0, column=0, sticky=N+W+E)
        self.buttonLoadFile = Button(self.frameDataFiles, text="Load Data File",
                                     command=self.loadFile)
        self.buttonLoadFile.grid(row=0, column=0, padx=1, pady=1,
                                 sticky=N+W+E)
        self.buttonRemoveFile = Button(self.frameDataFiles, text="Remove Selected File",
                                       command=self.removeDataObject)
        self.buttonRemoveFile.grid(row=1, column=0, padx=1, pady=1, sticky=N+W+E)
        self.frameDataObjects = LabelFrame(self.tab1, text="Data Files")
        self.frameDataObjects.grid(row=0, column=1, padx=1, pady=1, sticky=N+W+E)

        self.frameGroups = LabelFrame(self.tab1, text="Group Selection")
        self.frameGroups.grid(row=1, column=0, padx=1, pady=1,
                              sticky=N+W+E )
        Label(self.frameGroups, text="").grid(row=0, column=0, sticky=N+W+E)
        self.frameChannels = LabelFrame(self.tab1, text="Channel Selection")
        self.frameChannels.grid(row=1, column=1, padx=1, pady=1,
                                sticky=N+W+E)
        Label(self.frameChannels, text="").grid(row=0, column=0, sticky=N+W+E)

        self.frameTab1BottomLeft = Frame(self.tab1)
        self.frameTab1BottomLeft.grid(row=2, column=0, padx=1, pady=1, sticky=N+W+E)
        self.buttonSaveFile = Button(self.frameTab1BottomLeft, text="Save Selected to Pickle",
                                     command=self.saveFile)
        self.buttonSaveFile.grid(row=0, column=0, padx=1, pady=1,
                                 sticky=N+W+E)

        self.buttonSaveCSV = Button(self.frameTab1BottomLeft, text="Save Selected to CSV",
                                    command=self.saveCSV)
        self.buttonSaveCSV.grid(row=1, column=0, padx=1, pady=1, sticky=N+W+E)

        self.buttonGetThickness = Button(self.frameTab1BottomLeft, text="Get Mach-1 Thicknesses",
                                         command=self.findThicknesses)
        self.buttonGetThickness.grid(row=2, column=0, padx=1, pady=1, sticky=N+W+E)

        self.buttonPlot = Button(self.frameTab1BottomLeft, text="Plot Selected Channels",
                                 command=self.plotChannels)
        self.buttonPlot.grid(row=3, column=0, padx=1, pady=1,
                             sticky=N+W+E)

        self.frameTab1BottomRight = Frame(self.tab1)
        self.frameTab1BottomRight.grid(row=2, column=1, padx=1, pady=1, sticky=N+W+E)
        self.buttonMovingAvg = Button(self.frameTab1BottomRight, text="Apply Moving Average",
                                      command=self.applyMovingAvg)
        self.buttonMovingAvg.grid(row=0, column=0, padx=1, pady=1, columnspan=2,
                                  sticky=N+W+E)
        self.windowSize = IntVar(value=10)
        Label(self.frameTab1BottomRight, text="Window Size").grid(row=1, column=0, padx=1, pady=1,
                                                                  sticky=N+W)
        Entry(self.frameTab1BottomRight, textvariable=self.windowSize, width=4).grid(row=1, column=1, padx=1,
                                                                                     pady=1, sticky=N+W)
        #####  END TAB 1 #####

        ##### BEGIN TAB 2 #####
        self.frameImageButtons = Frame(self.tab2)
        self.frameImageButtons.grid(row=0, column=0, padx=1, pady=1, sticky=N+W+E)
        self.buttonLoadImage = Button(self.frameImageButtons, text="Load Image",
                                      command=self.loadImage)
        self.buttonLoadImage.grid(row=0, column=0, padx=1, pady=1, sticky=N+W+E)

        self.buttonLoadMapFile = Button(self.frameImageButtons, text="Load Mach-1 Site Locations",
                                        command=self.loadMachMap)

        self.buttonLoadMapFile.grid(row=1, column=0, padx=1, pady=1, sticky=N+W+E)
        self.buttonDefineMask = Button(self.frameImageButtons, text="Define Mask",
                                       command=self.cropImage)
        self.buttonDefineMask.grid(row=2, column=0, padx=1, pady=1, sticky=N+W+E)
        self.buttonClearMask = Button(self.frameImageButtons, text="Clear Mask",
                                      command=self.clearMask)
        self.buttonClearMask.grid(row=3, column=0, padx=1, pady=1, sticky=N+W+E)

        self.frameFieldVariables = LabelFrame(self.tab2, text="Field Variables")
        self.frameFieldVariables.grid(row=1, column=0, padx=1, pady=1, sticky=N+W+E)

        ##### END TAB 2 #####
        self.grid()
开发者ID:siboles,项目名称:PoroMech,代码行数:95,代码来源:PoroMechGUI.py


示例17: initGUI

    def initGUI(self):
        #create root window
        self.rootWindow = Tk()
        self.statusText = StringVar(value=self.statusStr) 
        self.setStatusStr("Simulation not yet started")

        self.rootWindow.wm_title(self.titleText)
        self.rootWindow.protocol('WM_DELETE_WINDOW',self.quitGUI)
        self.rootWindow.geometry('550x400')
        self.rootWindow.columnconfigure(0, weight=1)
        self.rootWindow.rowconfigure(0, weight=1)
        
        self.notebook = Notebook(self.rootWindow)      
        self.notebook.grid(row=0,column=0,padx=2,pady=2,sticky='nswe')
        

        self.frameRun = Frame()
        self.frameSettings = Frame()
        self.frameParameters = Frame()
        self.frameInformation = Frame()          
        
        self.notebook.add(self.frameRun,text="Run")
        self.notebook.add(self.frameSettings,text="Settings")
        self.notebook.add(self.frameParameters,text="Parameters")
        self.notebook.add(self.frameInformation,text="Info")
     
        self.notebook.pack(expand=YES, fill=BOTH, padx=5, pady=5 ,side=TOP)
        self.status = Label(self.rootWindow, width=40,height=3, relief=SUNKEN, bd=1,textvariable=self.statusText)
        self.status.grid(row=1,column=0,padx=2,pady=2,sticky='nswe')
        self.status.pack(side=TOP, fill=X, padx=1, pady=1, expand=NO)



        
        self.runPauseString = StringVar()
        self.runPauseString.set("Run")
        self.buttonRun = Button(self.frameRun,width=30,height=2,textvariable=self.runPauseString,command=self.runEvent)
        self.buttonRun.pack(side=TOP, padx=5, pady=5)



        self.showHelp(self.buttonRun,"Runs the simulation (or pauses the running simulation)")
        self.buttonStep = Button(self.frameRun,width=30,height=2,text='Step Once',command=self.stepOnce)
        self.buttonStep.pack(side=TOP, padx=5, pady=5)
        self.showHelp(self.buttonStep,"Steps the simulation only once")
        self.buttonReset = Button(self.frameRun,width=30,height=2,text='Reset',command=self.resetModel)
        self.buttonReset.pack(side=TOP, padx=5, pady=5) 
        self.showHelp(self.buttonReset,"Resets the simulation")
 
   
        
        can = Canvas(self.frameSettings)
        lab = Label(can, width=25,height=1,text="Step size ", justify=LEFT, anchor=W,takefocus=0)
        lab.pack(side='left')
        self.stepScale = Scale(can,from_=1, to=50, resolution=1,command=self.changeStepSize,orient=HORIZONTAL, width=25,length=150)
        self.stepScale.set(self.stepSize)
        self.showHelp(self.stepScale,"Skips model redraw during every [n] simulation steps\nResults in a faster model run.")
        self.stepScale.pack(side='left')    
        can.pack(side='top')
    
        can = Canvas(self.frameSettings)
        lab = Label(can, width=25,height=1,text="Step visualization delay in ms ", justify=LEFT, anchor=W,takefocus=0)
        lab.pack(side='left')
        self.stepDelay = Scale(can,from_=0, to=max(2000,self.timeInterval), resolution=10,command=self.changeStepDelay,orient=HORIZONTAL, width=25,length=150)
        self.stepDelay.set(self.timeInterval)
        self.showHelp(self.stepDelay,"The visualization of each step is delays by the given number of milliseconds.")
        self.stepDelay.pack(side='left')    
        can.pack(side='top')
        scrollInfo = Scrollbar(self.frameInformation)
        self.textInformation = Text(self.frameInformation, width=45,height=13,bg='lightgray',wrap=WORD,font=("Courier",10))
        scrollInfo.pack(side=RIGHT, fill=Y)
        self.textInformation.pack(side=LEFT,fill=BOTH,expand=YES)
        scrollInfo.config(command=self.textInformation.yview)
        self.textInformation.config(yscrollcommand=scrollInfo.set)
        for variableSetter in self.parameterSetters:
            can = Canvas(self.frameParameters)
            lab = Label(can, width=25,height=1,text=variableSetter.__name__+" ",anchor=W,takefocus=0)
            lab.pack(side='left')
            ent = Entry(can, width=11)
            ent.insert(0, str(variableSetter()))
            if variableSetter.__doc__ != None and len(variableSetter.__doc__) > 0:
                self.showHelp(ent,variableSetter.__doc__.strip())
            ent.pack(side='left')            
            can.pack(side='top')
            self.varEntries[variableSetter]=ent
        if len(self.parameterSetters) > 0:
            self.buttonSaveParameters = Button(self.frameParameters,width=50,height=1,command=self.saveParametersCmd,text="Save parameters to the running model",state=DISABLED)
            self.showHelp(self.buttonSaveParameters,"Saves the parameter values.\nNot all values may take effect on a running model\nA model reset might be required.")
            self.buttonSaveParameters.pack(side='top',padx=5,pady=5)
            self.buttonSaveParametersAndReset = Button(self.frameParameters,width=50,height=1,command=self.saveParametersAndResetCmd,text="Save parameters to the model and reset the model")
            self.showHelp(self.buttonSaveParametersAndReset,"Saves the given parameter values and resets the model")
            self.buttonSaveParametersAndReset.pack(side='top',padx=5,pady=5)
开发者ID:joh,项目名称:cxboids,代码行数:92,代码来源:pycxsimulator.py


示例18: __init__

    def __init__(self, master):
        
	self.fname="" 
        #global variables
        self.t1=StringVar()
        self.t2=StringVar()
        self.t3=StringVar()
        self.t4=StringVar()
        self.t5=StringVar()
        self.t6=StringVar()
        self.t7=StringVar()
        self.t8=StringVar()
        self.t9=StringVar()
        self.t10=StringVar()
        self.t11=StringVar()
        self.t12=StringVar()
        
        self.var1=StringVar()
        self.var2=StringVar()
        self.var3=StringVar()
        self.var4=StringVar()
        self.var5=StringVar()
        self.var6=StringVar()
        self.var7=StringVar()
        self.var8=StringVar()
        self.var9=StringVar()
        self.var10=StringVar()
        self.var11=StringVar()
        self.var12=StringVar()
        #end
        
        mymaster = Frame(master, name='mymaster') # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window    
        #master.minsize(width=900, height=900)
        #master.maxsize(width=800, height=600)
        #end
        
        #title of window
        master.title("Airtun-ng")
        #end
        
        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont=tkFont.Font(family="Helvetica", size=15,underline = True)
        self.myfontnew=tkFont.Font(family="Helvetica", size=11,underline = True)
        #end
        
        
       
        nb = Notebook(mymaster, name='nb') # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3) # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1") # add tab to Notebook
    
        # repeat for each tab
        self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")
        
        #End
        
	#frame content 7
	Label(self.frame_content7, text = 'Aigraph-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        btndetect=Button(self.frame_content7, text = 'Detect', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 1, column = 0, padx = 5, pady = 5)
		
	btndbrowse=Button(self.frame_content7, text = 'Attach File', command =self.browse_file, height=2, width=15, font=self.customFont).grid(row = 3, column = 0, padx = 5, pady = 5)	
	self.lilnew1=Listbox(self.frame_content7,bg="black", fg="white", font=self.myfont, selectmode=SINGLE, width=30, height=15)
        self.lilnew1.grid(row = 1, column = 1, rowspan=3)
	#End
	
        Label(self.frame_content, text = 'Airtun-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content, text = 'Options :',font=self.myfontnew, bg="white").grid(row = 1, column = 1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5, text = 'Edit Command From Here',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 0, column = 0)
        TextCommandBox=Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output=Text(self.frame_content5,bg="black", fg="white", font=self.myfont, height=20, width=42)
        self.output.grid(row = 0, column = 1, padx=50, pady=5, rowspan=3)
        btnsubmit=Button(self.frame_content5, width=15, height=2, text="Get Result", command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear=Button(self.frame_content5, width=15, height=2, text="Clear Output", command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-x", \
                 onvalue = "-x", offvalue ="", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var1)
        self.C1.grid(row = 2, column = 0, padx = 5, pady = 5)
        self.t1=Text(self.frame_content,height=1,width = 20)
        self.t1.grid(row = 2, column = 1, padx = 5, pady = 5)
        l1=Label(self.frame_content, text = ': maximum number of packets per second (optional)',font=self.myfont, bg="white", justify=LEFT).grid(row = 2, column = 2, padx = 5, pady = 5)
        
#.........这里部分代码省略.........
开发者ID:AsmitaKatyayni,项目名称:Airvengers,代码行数:101,代码来源:Airtun-ng.py


示例19: MainWindow


#.........这里部分代码省略.........
        self.next_button = Button(self.toolbar, text='Next', command=self.cmd_next)
        self.next_button.grid(column=2, row=0)

        self.return_button = Button(self.toolbar, text='Return', command=self.cmd_r 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python ttk.Progressbar类代码示例发布时间:2022-05-27
下一篇:
Python ttk.Label类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap