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


Python tkinter.ALL属性代码示例

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


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

示例1: center_on_node

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def center_on_node(self, data_node):
        """Center canvas on given **DATA** node"""
        try:
            disp_node = self._find_disp_node(data_node)
        except ValueError as e:
            tkm.showerror("Unable to find node", str(e))
            return
        x,y = self.coords(self.dispG.node[disp_node]['token_id'])

        # Find center of canvas
        w = self.winfo_width()/2
        h = self.winfo_height()/2
        if w == 0:
            # We haven't been drawn yet
            w = int(self['width'])/2
            h = int(self['height'])/2

        # Calc delta to move to center
        delta_x = w - x
        delta_y = h - y

        self.move(tk.ALL, delta_x, delta_y) 
开发者ID:jsexauer,项目名称:networkx_viewer,代码行数:24,代码来源:graph_canvas.py

示例2: draw_puzzle

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def draw_puzzle(puzzle_frame, n, read_only=False):
    """
    Fills a frame widget with n + 1 entry widget.

    puzzle_frame : The puzzle frame to get filled by entry widgets.
    n : Puzzle type (n-puzzle).
    read_only : Should widgets be read-only or not
    """
    n = int(math.sqrt(n + 1))

    for i in range(n):
        for j in range(n):
            entry = tkinter.Entry(puzzle_frame, width=4, justify='center')
            entry.grid(row=i, column=j, sticky='WENS')

            if read_only:
                # Bind the widget validation command to return_false_validate command and therefore
                #   OUTPUT_EDITABLE global variable.
                entry.config(validatecommand=return_false_validate, validate=tkinter.ALL)

        puzzle_frame.grid_columnconfigure(i, weight=1)
        puzzle_frame.grid_rowconfigure(i, weight=1) 
开发者ID:mahdavipanah,项目名称:pynpuzzle,代码行数:24,代码来源:pynpuzzle.py

示例3: delete_marker

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def delete_marker(self, iid):
        """
        Delete a marker from the TimeLine

        :param iid: marker identifier
        :type iid: str
        """
        if iid == tk.ALL:
            for iid in self.markers.keys():
                self.delete_marker(iid)
            return
        options = self._markers[iid]
        rectangle_id, text_id = options["rectangle_id"], options["text_id"]
        del self._canvas_markers[rectangle_id]
        del self._canvas_markers[text_id]
        del self._markers[iid]
        self._timeline.delete(rectangle_id, text_id) 
开发者ID:TkinterEP,项目名称:ttkwidgets,代码行数:19,代码来源:timeline.py

示例4: _zoom

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def _zoom(self, evt):
        if evt.num == 4:
            evt.delta = 1
        elif evt.num == 5:
            evt.delta = -1
        s = 1.5 if evt.delta > 0 else 1 / 1.5
        self.scale /= s
        x0 = s * self.canvas.canvasx(evt.x) - evt.x
        y0 = s * self.canvas.canvasy(evt.y) - evt.y
        self.canvas.scale(tkinter.ALL, 0, 0, s, s)
        self.canvas.x_rl *= s
        self.canvas.y_rl *= s
        bb = self.canvas.bbox(tkinter.ALL)
        if bb is not None:
            w = (bb[2] - bb[0]) * 1.2
            h = (bb[3] - bb[1]) * 1.2
            bb = (bb[0] - w, bb[1] - h, bb[2] + w, bb[3] + h)
            self.canvas["scrollregion"] = bb
            self.canvas.xview(tkinter.MOVETO, (x0 - bb[0]) / (bb[2] - bb[0]))
            self.canvas.yview(tkinter.MOVETO, (y0 - bb[1]) / (bb[3] - bb[1])) 
开发者ID:heitzmann,项目名称:gdspy,代码行数:22,代码来源:viewer.py

示例5: _zoom_in

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def _zoom_in(self):
        s = 1.5
        self.scale /= s
        self.canvas.scale(tkinter.ALL, 0, 0, s, s)
        self.canvas.x_rl *= s
        self.canvas.y_rl *= s
        bb = self.canvas.bbox(tkinter.ALL)
        w = (bb[2] - bb[0]) * 1.2
        h = (bb[3] - bb[1]) * 1.2
        bb = (bb[0] - w, bb[1] - h, bb[2] + w, bb[3] + h)
        self.canvas["scrollregion"] = bb
        x0 = self.xscroll.get()
        x0 = 0.5 * (x0[1] + x0[0]) - 0.5 * (
            (float(self.canvas.winfo_width()) - self.canvas_margins[0])
            / (bb[2] - bb[0])
        )
        y0 = self.yscroll.get()
        y0 = 0.5 * (y0[1] + y0[0]) - 0.5 * (
            (float(self.canvas.winfo_height()) - self.canvas_margins[1])
            / (bb[3] - bb[1])
        )
        self.canvas.xview(tkinter.MOVETO, x0)
        self.canvas.yview(tkinter.MOVETO, y0) 
开发者ID:heitzmann,项目名称:gdspy,代码行数:25,代码来源:viewer.py

示例6: _zoom_out

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def _zoom_out(self):
        s = 1 / 1.5
        self.scale /= s
        self.canvas.scale(tkinter.ALL, 0, 0, s, s)
        self.canvas.x_rl *= s
        self.canvas.y_rl *= s
        bb = self.canvas.bbox(tkinter.ALL)
        w = (bb[2] - bb[0]) * 1.2
        h = (bb[3] - bb[1]) * 1.2
        bb = (bb[0] - w, bb[1] - h, bb[2] + w, bb[3] + h)
        self.canvas["scrollregion"] = bb
        x0 = self.xscroll.get()
        x0 = 0.5 * (x0[1] + x0[0]) - 0.5 * (
            (float(self.canvas.winfo_width()) - self.canvas_margins[0])
            / (bb[2] - bb[0])
        )
        y0 = self.yscroll.get()
        y0 = 0.5 * (y0[1] + y0[0]) - 0.5 * (
            (float(self.canvas.winfo_height()) - self.canvas_margins[1])
            / (bb[3] - bb[1])
        )
        self.canvas.xview(tkinter.MOVETO, x0)
        self.canvas.yview(tkinter.MOVETO, y0) 
开发者ID:heitzmann,项目名称:gdspy,代码行数:25,代码来源:viewer.py

示例7: drawGrid

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def drawGrid(self, clearGrid = False):
		font = tkFont.Font(family=zynthian_gui_config.font_topbar[0], size=self.fontsize)
		if clearGrid:
			self.gridCanvas.delete(tkinter.ALL)
			self.columnWidth = self.gridWidth / self.horizontalZoom
			self.trackTitleCanvas.delete("trackname")
		self.playCanvas.delete("timetext")
		# Draw cells of grid
		self.gridCanvas.itemconfig("gridcell", fill=CELL_BACKGROUND)
		for row in range(self.verticalZoom):
			if row >= len(self.tracks):
				break
			if clearGrid:
				self.trackTitleCanvas.create_text((0, self.rowHeight * (row + 0.5)), text="Track %d" % (self.tracks[row]), font=font, fill=CELL_FOREGROUND, tags=("rowtitle%d" % (row),"trackname"), anchor="w")
				self.gridCanvas.create_text(self.gridWidth - self.selectThickness, self.rowHeight * (self.rowHeight * int(row + 0.5)), state="hidden", tags=("lastpatterntext%d" % (row), "lastpatterntext"), font=font, anchor="e")
			self.drawRow(row)
		self.playCanvas.create_text(0 * self.columnWidth, PLAYHEAD_HEIGHT / 2, text="%d"%(self.colOffset), tags=("timetext"), anchor="w", fill=CELL_FOREGROUND)

		if clearGrid:
			for clock in range(self.horizontalZoom):
				self.gridCanvas.tag_lower("clock%d"%clock)

	# Function to update selectedCell
	#	clock: Clock (column) of selected cell (Optional - default to reselect current column)
	#	track: Track number of selected cell (Optional - default to reselect current =row) 
开发者ID:zynthian,项目名称:zynthian-ui,代码行数:27,代码来源:zynthian_gui_songeditor.py

示例8: OnVideoListClick

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def OnVideoListClick(self, event):
        """ load clip data """
        item = self.vid_tree.identify('item', event.x, event.y)
        vid = self.vid_tree.item(item, "text")
        self.vid = vid

        self.tx_vid_name.configure(text=vid)
        self.tx_clip_interval.configure(text='No selected clip')
        self.img_canvas.delete(tk.ALL)
        self.message.config(text=' ')
        self.tx_ratio_small.config(text='None')
        self.tx_ratio_side.config(text='None')
        self.tx_ratio_missing.config(text='None')
        self.tx_ratio_back.config(text='None')
        self.tx_frame_diff.config(text='None')

        print(vid)

        self.clip_data = load_clip_data(vid)
        self.skeleton = SkeletonWrapper(my_config.SKELETON_PATH, vid)
        self.video_wrapper = read_video(my_config.VIDEO_PATH, vid)
        self.clip_filter_data = load_clip_filtering_aux_info(vid)

        self.load_clip()
        self.win.update() 
开发者ID:youngwoo-yoon,项目名称:youtube-gesture-dataset,代码行数:27,代码来源:review_filtered_clips.py

示例9: onPanMotion

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def onPanMotion(self, event):
        # compute how much to move
        delta_x = event.x - self._pan_data[0]
        delta_y = event.y - self._pan_data[1]
        self.move(tk.ALL, delta_x, delta_y)

        # Record new location
        self._pan_data = (event.x, event.y) 
开发者ID:jsexauer,项目名称:networkx_viewer,代码行数:10,代码来源:graph_canvas.py

示例10: clear

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def clear(self):
        """Clear the canvas and display graph"""
        self.delete(tk.ALL)
        self.dispG.clear() 
开发者ID:jsexauer,项目名称:networkx_viewer,代码行数:6,代码来源:graph_canvas.py

示例11: clear_timeline

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def clear_timeline(self):
        """
        Clear the contents of the TimeLine Canvas

        Does not modify the actual markers dictionary and thus after
        redrawing all markers are visible again.
        """
        self._timeline.delete(tk.ALL)
        self._canvas_ticks.delete(tk.ALL) 
开发者ID:TkinterEP,项目名称:ttkwidgets,代码行数:11,代码来源:timeline.py

示例12: _clearCanvas

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def _clearCanvas(self, event):
        self.history.clear()
        self.canvas.delete(tkinter.ALL) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:5,代码来源:Main.py

示例13: _undoCanvas

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def _undoCanvas(self, event):
        self.history.undo()
        self.canvas.delete(tkinter.ALL)
        self.history.execute() 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:6,代码来源:Main.py

示例14: on_canvas_resize

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def on_canvas_resize(canvas):
    ''' This function updates scroll region of the canvas.
        It should be called on canvas resize.

        Args:
            canvas (Canvas): canvas
    '''
    canvas.update_idletasks()
    yscroll = 0
    xscroll = 0
    if canvas.bbox(ALL)[2] > canvas.winfo_width():
        yscroll = canvas.bbox(ALL)[2]
    if canvas.bbox(ALL)[3] > canvas.winfo_height():
        xscroll = canvas.bbox(ALL)[3]
    canvas['scrollregion'] = (0, 0, yscroll, xscroll) 
开发者ID:araith,项目名称:pyDEA,代码行数:17,代码来源:dea_utils.py

示例15: update_scroll_region

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import ALL [as 别名]
def update_scroll_region(self):
        ''' Updates scrolling region.
        '''
        self.frame_with_boxes.update()
        self.canvas['scrollregion'] = self.canvas.bbox(ALL) 
开发者ID:araith,项目名称:pyDEA,代码行数:7,代码来源:categories_checkbox_gui.py


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