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


Python tkinter.RAISED属性代码示例

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


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

示例1: __create_widgets

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def __create_widgets(self):
        self.dockFrame = ttk.Frame(self, relief=tk.RAISED, padding=PAD)
        self.dockLeftButton = ttk.Button(self.dockFrame,
                image=self.images[DOCKLEFT], style="Toolbutton",
                command=self.dock_left)
        TkUtil.Tooltip.Tooltip(self.dockLeftButton, text="Dock Left")
        self.dockRightButton = ttk.Button(self.dockFrame,
                image=self.images[DOCKRIGHT], style="Toolbutton",
                command=self.dock_right)
        TkUtil.Tooltip.Tooltip(self.dockRightButton, text="Dock Right")
        self.dockLabel = ttk.Label(self.dockFrame, text=self.title,
                anchor=tk.CENTER)
        TkUtil.Tooltip.Tooltip(self.dockLabel, text="Drag and drop to "
                "dock elsewhere or to undock")
        self.undockButton = ttk.Button(self.dockFrame,
                image=self.images[UNDOCK], style="Toolbutton",
                command=self.undock)
        TkUtil.Tooltip.Tooltip(self.undockButton, text="Undock")
        self.hideButton = ttk.Button(self.dockFrame,
                image=self.images[HIDE], style="Toolbutton",
                command=lambda *args: self.visible.set(False))
        TkUtil.Tooltip.Tooltip(self.hideButton, text="Hide")
        self.create_widgets() 
开发者ID:lovexiaov,项目名称:python-in-practice,代码行数:25,代码来源:Dock.py

示例2: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def __init__(self, parent, char, font=("Courier", 14)):
        super().__init__(parent,
                bd=2,
                relief=tk.RAISED,
                bg="black",
                fg="white",
                font=font)

        if not char.strip():
            self["state"] = tk.DISABLED    
            self["relief"] = tk.FLAT
            self["bd"] = 0
        
        self.char = char
        self.target = None
        self.configure(text=self.char, command=self.on_press)
        
        Key.all_keys.append(self) 
开发者ID:BnetButter,项目名称:hwk-mirror,代码行数:20,代码来源:tkwidgets.py

示例3: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def __init__(self, parent, category, **kwargs):
        super().__init__(parent, **kwargs)
        self.category = category
        self.price_input = lib.PriceInput(self, 
                font=self.font,
                width=7,
                conditional_bind=False)
        self.price_input.configure(state=tk.NORMAL)
        self.grid_columnconfigure(0, weight=1)
        self.grid_columnconfigure(1, weight=1)
        self.button = lib.MessageButton(self, text="Open Charge",
                anchor=tk.W, 
                font=self.font,
                relief=tk.RAISED,
                bd=2)
        
        self.button.command = self.add_item
        self.button.grid(row=0, column=0, sticky="nswe")
        self.price_input.grid(row=0, column=1, sticky="nswe") 
开发者ID:BnetButter,项目名称:hwk-mirror,代码行数:21,代码来源:menu_display.py

示例4: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def __init__(self, master):
        self.frame = ttk.Frame(master, width = 100, height = 100)   # frame height and width are in pixel
        self.frame.pack()
        self.frame.config(relief = tk.RAISED)   # to define frame boarder
        self.button = ttk.Button(self.frame, text = 'Click for Magic')
        self.button.config(command = self.performMagic)
        self.button.grid()  # use grid geometry manager
        self.frame.config(padding = (30,15))
        
        self.lbfrm = ttk.LabelFrame(master, width = 100, height = 100)
        self.lbfrm.config(padding = (30, 15))
        self.lbfrm.config(text = "Magic Below")
        self.lbfrm.pack()
        self.label = ttk.Label(self.lbfrm, text = "Waiting for Magic")
        self.label.grid() 
开发者ID:adipandas,项目名称:python-gui-demos,代码行数:17,代码来源:program9.py

示例5: start_progress_bar

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def start_progress_bar(self, path):
        '''Pop up a progress bar starting at 0% while the wordlist is processing
        '''
        self.progress_path = path
        
        self.progress_popup = Tk.Toplevel()
        self.progress_popup.title('Processing')
        self.progress_popup.resizable(width=False, height=False)
        self.progress_popup.grab_set()
        self.progress_popup.overrideredirect(1)
        
        progress_frame = Tk.Frame(self.progress_popup, borderwidth=1, relief=Tk.RAISED)
        progress_frame.pack(side='top', fill='both', padx=10, pady=10)
        
        path_label = Tk.Label(progress_frame, text='', font=('Helvetica', '12'))
        path_label.pack(padx=10, pady=10)
        path_label.configure(text="Processing to '{}'...".format(path))
        
        self.progress_var = Tk.DoubleVar()
        self.progress_bar = ttk.Progressbar(progress_frame, variable=self.progress_var,
            length=300, maximum=100, style='plain.Horizontal.TProgressbar')
        self.progress_bar.pack(side='left', padx=10, pady=10)
        
        self.progress_percent_lb = Tk.Label(progress_frame, text='', font=('Helvetica', '12'))
        self.progress_percent_lb.pack(side='left', padx=10, pady=10)
        self.progress_percent_lb.configure(text='0%')
        
        def stop(): self.controller.stop_processing_flag = True
        self.progress_btn = Tk.Button(progress_frame, text='Cancel', command=stop)
        self.progress_btn.pack(side='left', padx=10, pady=20)
        
        center_window(self.progress_popup, self.master)
        self.progress_popup.update() 
开发者ID:sc0tfree,项目名称:mentalist,代码行数:35,代码来源:main.py

示例6: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def __init__(self, controller, master=None, main=None, title='Title', right_label_text=None, allow_remove=True, number=1, **kwargs):
        '''
        controller: a mentalist.controller.Controller instance
        master: the tkinter master of this view
        main: a mentalist.view.Main instance
        title: the title string to be displayed for this node
        right_label_text: an optional string to be displayed on the right-hand
                          side (word count)
        allow_remove: False if attempting to remove this node gives an error message
        number: an integer starting with 1 identifying this node's position in the chain
        '''
        Frame.__init__(self, master=master, **kwargs)
        self.controller = controller
        self.title = title
        self.main = main
        self.attrs = []
        self.number = number
        self.allow_remove = allow_remove
        self.configure(borderwidth=1, relief=Tk.RAISED)
        self.upper_frame = Frame(self)
        self.upper_frame.configure(borderwidth=1, relief=Tk.RIDGE)
        self.lb_title = Tk.Label(self.upper_frame, text='{}. {}'.format(number, title))
        self.lb_title.pack(fill="both", side="left", padx=10, pady=10)
        
        if right_label_text is not None: # this is the right-justified word count label
            self.right_label = Tk.Label(self.upper_frame, text=right_label_text, font=('Helvetica', '10', 'italic'))
            self.right_label.pack(fill="both", side="right", padx=10, pady=10)
        else:
            self.right_label = None
        
        self.upper_frame.pack(side="top", fill="x", expand=1)
        self.lower_frame = Frame(self)
        self.lower_frame.pack(side="bottom", fill="both")
        self.add_upper_button()
        if self.allow_remove:
            self.add_remove_button()
        self.pack(side="top", fill="both", padx=2, pady=2) 
开发者ID:sc0tfree,项目名称:mentalist,代码行数:39,代码来源:base.py

示例7: create_file_toolbar

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def create_file_toolbar(self):
        settings = TkUtil.Settings.Data
        self.fileToolbar = ttk.Frame(self.toolbarFrame, relief=tk.RAISED)
        self.fileToolbar.text = FILE_TOOLBAR
        self.fileToolbar.underline = 0
        menuButton = ttk.Button(self.fileToolbar,
                text="File Toolbar Menu", 
                image=self.toolbarImages[TOOLBARMENU],
                command=self.toolbar_menu)
        TkUtil.bind_context_menu(menuButton, self.toolbar_menu)
        TkUtil.Tooltip.Tooltip(menuButton, text="File Toolbar Menu")
        newButton = ttk.Button(self.fileToolbar, text=NEW,
                image=self.toolbarImages[NEW], command=self.new)
        TkUtil.Tooltip.Tooltip(newButton, text="New Document")
        openButton = ttk.Button(self.fileToolbar, text=OPEN,
                image=self.toolbarImages[OPEN], command=self.open)
        TkUtil.Tooltip.Tooltip(openButton, text="Open Document")
        self.saveButton = ttk.Button(self.fileToolbar, text=SAVE,
                image=self.toolbarImages[SAVE], command=self.save)
        TkUtil.Tooltip.Tooltip(self.saveButton, text="Save Document")
        preferencesButton = ttk.Button(self.fileToolbar,
                text=PREFERENCES, image=self.toolbarImages[PREFERENCES],
                command=self.preferences)
        TkUtil.Tooltip.Tooltip(preferencesButton, text=PREFERENCES)
        TkUtil.add_toolbar_buttons(self.fileToolbar, (menuButton,
                newButton, openButton, self.saveButton, None,
                preferencesButton))
        self.toolbars.append(self.fileToolbar) 
开发者ID:lovexiaov,项目名称:python-in-practice,代码行数:30,代码来源:Main.py

示例8: create_edit_toolbar

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def create_edit_toolbar(self):
        settings = TkUtil.Settings.Data
        self.editToolbar = ttk.Frame(self.toolbarFrame, relief=tk.RAISED)
        self.editToolbar.text = EDIT_TOOLBAR
        self.editToolbar.underline = 0
        menuButton = ttk.Button(self.editToolbar,
                text="Edit Toolbar Menu", 
                image=self.toolbarImages[TOOLBARMENU],
                command=self.toolbar_menu)
        TkUtil.bind_context_menu(menuButton, self.toolbar_menu)
        TkUtil.Tooltip.Tooltip(menuButton, text="Edit Toolbar Menu")
        self.undoButton = ttk.Button(self.editToolbar,
                text=UNDO, image=self.toolbarImages[UNDO],
                command=self.editor.edit_undo)
        TkUtil.Tooltip.Tooltip(self.undoButton, text=UNDO)
        self.redoButton = ttk.Button(self.editToolbar,
                text=REDO, image=self.toolbarImages[REDO],
                command=self.editor.edit_redo)
        TkUtil.Tooltip.Tooltip(self.redoButton, text=REDO)
        self.copyButton = ttk.Button(self.editToolbar,
                text=COPY, image=self.toolbarImages[COPY],
                command=self.editor.text.event_generate("<<Copy>>"))
        TkUtil.Tooltip.Tooltip(self.copyButton, text=COPY)
        self.cutButton = ttk.Button(self.editToolbar, text=CUT,
                image=self.toolbarImages[CUT],
                command=self.editor.text.event_generate("<<Cut>>"))
        TkUtil.Tooltip.Tooltip(self.cutButton, text=CUT)
        self.pasteButton = ttk.Button(self.editToolbar, text=PASTE,
                image=self.toolbarImages[PASTE],
                command=self.editor.text.event_generate("<<Paste>>"))
        TkUtil.Tooltip.Tooltip(self.pasteButton, text=PASTE)
        self.findButton = ttk.Button(self.editToolbar,
                text=FIND, image=self.toolbarImages[FIND],
                command=self.find)
        TkUtil.Tooltip.Tooltip(self.findButton, text=FIND)
        TkUtil.add_toolbar_buttons(self.editToolbar, (menuButton,
                self.undoButton, self.redoButton, None, self.copyButton,
                self.cutButton, self.pasteButton, None, self.findButton))
        self.toolbars.append(self.editToolbar) 
开发者ID:lovexiaov,项目名称:python-in-practice,代码行数:41,代码来源:Main.py

示例9: create_alignment_toolbar

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def create_alignment_toolbar(self):
        settings = TkUtil.Settings.Data
        self.alignmentToolbar = ttk.Frame(self.toolbarFrame,
                relief=tk.RAISED)
        self.alignmentToolbar.text = ALIGNMENT_TOOLBAR
        self.alignmentToolbar.underline = 0
        menuButton = ttk.Button(self.alignmentToolbar,
                text="Alignment Toolbar Menu", 
                image=self.toolbarImages[TOOLBARMENU],
                command=self.toolbar_menu)
        TkUtil.bind_context_menu(menuButton, self.toolbar_menu)
        TkUtil.Tooltip.Tooltip(menuButton, text="Alignment Toolbar Menu")
        self.leftButton = ttk.Button(self.alignmentToolbar,
                text=ALIGN_LEFT, image=self.toolbarImages[ALIGNLEFT])
        self.leftButton.config(
                command=lambda: self.toggle_alignment(tk.LEFT))
        TkUtil.Tooltip.Tooltip(self.leftButton, text=ALIGN_LEFT)
        self.centerButton = ttk.Button(self.alignmentToolbar,
                text=ALIGN_CENTER, 
                image=self.toolbarImages[ALIGNCENTER])
        self.centerButton.config(
                command=lambda: self.toggle_alignment(tk.CENTER))
        TkUtil.Tooltip.Tooltip(self.centerButton, text=ALIGN_CENTER)
        self.rightButton = ttk.Button(self.alignmentToolbar,
                text=ALIGN_RIGHT, image=self.toolbarImages[ALIGNRIGHT])
        self.rightButton.config(
                command=lambda: self.toggle_alignment(tk.RIGHT))
        TkUtil.Tooltip.Tooltip(self.rightButton, text=ALIGN_RIGHT)
        TkUtil.add_toolbar_buttons(self.alignmentToolbar, (menuButton,
                self.leftButton, self.centerButton, self.rightButton))
        self.toolbars.append(self.alignmentToolbar)
        self.leftButton.state((TkUtil.SELECTED,))
        self.alignment.set(tk.LEFT) 
开发者ID:lovexiaov,项目名称:python-in-practice,代码行数:35,代码来源:Main.py

示例10: create

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def create(self, filename='none'):
        """
        This method creates a horizontal AreaVi widget. It returns the
        AreaVi widget that was created. It as well installs the plugins
        that appear in the vyrc file in the AreaVi widget.
        """
        frame     = Frame(master=self)
        scrollbar = Scrollbar(master=frame)
        area      = AreaVi(filename, frame , border=3, relief=RAISED, 
                           yscrollcommand=scrollbar.set)
        scrollbar.config(command=area.yview)
        scrollbar.pack(side='right', fill=Y)

        from vyapp.plugins import HANDLE

        for handle, args, kwargs in HANDLE:
            handle(area, *args, **kwargs)

        area.focus_set()
        area.pack(expand=True, side='left', fill=BOTH)
        self.add(frame)

        def save_focus(event):
            self.master.focused_area = area

        self.master.focused_area = area
        area.bind('<FocusIn>', save_focus)
        return area 
开发者ID:vyapp,项目名称:vy,代码行数:30,代码来源:panel.py

示例11: update

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def update(self, ticket):
        order_queue = lib.AsyncTk().forward("order_queue")
        name = order_queue[str(ticket.ticket_no)]["name"]
        deliver = order_queue[str(ticket.ticket_no)]["deliver"]
        if not ticket:
            return self.reset()
        self.ticket = ticket
        self["relief"] = tk.RIDGE
        self.ticket_no["relief"] = tk.RAISED
        
        text = "{:03d}".format(ticket.ticket_no)
        if name:
            text += f": {name}"
        self.ticket_no["text"] = text
        self.item_info.update(ticket)
        self.addon1_info.update(ticket.addon1)
        self.addon2_info.update(ticket.addon2)

        if deliver:
            self.deliver.grid()
            self.deliver.lift()
            self["bg"] = "red"
            self.ticket_no["bg"] = "red"
        else:
            self.deliver.grid_remove()
            self["bg"] = "white smoke"
            self.ticket_no["bg"] = "white smoke" 
开发者ID:BnetButter,项目名称:hwk-mirror,代码行数:29,代码来源:ticketbox.py

示例12: on_release

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def on_release(self, *args):
        if self._active:
            self.configure(relief=tk.RAISED, fg="black")
            self.command() 
开发者ID:BnetButter,项目名称:hwk-mirror,代码行数:6,代码来源:tkwidgets.py

示例13: activate

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def activate(self):
        self.configure(relief=tk.RAISED, fg="black")
        self._active = True 
开发者ID:BnetButter,项目名称:hwk-mirror,代码行数:5,代码来源:tkwidgets.py

示例14: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def __init__(self, parent, text, **kwargs):
        super().__init__(parent, text,
                config_true={"relief": tk.SUNKEN,"bg":"green3"},
                config_false={"relief": tk.RAISED, "bg":"red"},
                font=self.font)
        self.state=False
        # disable user control 
开发者ID:BnetButter,项目名称:hwk-mirror,代码行数:9,代码来源:network_status.py

示例15: update

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RAISED [as 别名]
def update(self, item):
        price = item.price + sum(item.options.get(opt, 0) for opt in item.selected_options)
        if item.name:
            self["relief"] = tk.RAISED
            self["text"] = type(self).fmt(price / 100)
        else:
            self["relief"] = tk.FLAT
            self["text"] = "" 
开发者ID:BnetButter,项目名称:hwk-mirror,代码行数:10,代码来源:order_display.py


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