pyworkflow.gui.canvas module
This module extends the functionalities of a normal Tkinter Canvas. The new Canvas class allows to easily display Texboxes and Edges that can be interactively dragged and clicked.
- class pyworkflow.gui.canvas.Cable(canvas, src, srcConnector, dst, dstConnector)[source]
Bases:
object
- class pyworkflow.gui.canvas.Canvas(parent, tooltipCallback=None, tooltipDelay=1500, **kwargs)[source]
Bases:
Canvas
,Scrollable
Canvas to draw some objects. It actually is a Frame, a Canvas and scrollbars
Construct a canvas widget with the parent MASTER.
Valid resource names: background, bd, bg, borderwidth, closeenough, confine, cursor, height, highlightbackground, highlightcolor, highlightthickness, insertbackground, insertborderwidth, insertofftime, insertontime, insertwidth, offset, relief, scrollregion, selectbackground, selectborderwidth, selectforeground, state, takefocus, width, xscrollcommand, xscrollincrement, yscrollcommand, yscrollincrement.
- captureLastPosition(event)[source]
Captures the last position the mouse were located upon the event
- drawGraph(graph, layout=None, drawNode=None, nodeList=None)[source]
Draw a graph in the canvas. nodes in the graph should have x and y. If layout is not None, it will be used to reorganize the node positions. Provide drawNode if you want to customize how to create the boxes for each graph node.
- class pyworkflow.gui.canvas.ColoredConnector(canvas, x, y, name, fillColor='blue', outline='black')[source]
Bases:
Connector
- class pyworkflow.gui.canvas.Connector(canvas, x, y, name)[source]
Bases:
Item
Default connector has no graphical representation (hence, it’ss invisible). Subclasses offer different looks
- class pyworkflow.gui.canvas.Edge(canvas, source, dest)[source]
Bases:
object
Edge between two objects
- class pyworkflow.gui.canvas.Item(canvas, x, y)[source]
Bases:
object
- BOTTOM = 2
- LEFT = 3
- RIGHT = 1
- TOP = 0
- addSocket(name, socketClass, verticalLocation, fillColor='blue', outline='black', position=None)[source]
- socketSeparation = 12
- verticalFlow = True
- class pyworkflow.gui.canvas.Oval(canvas, x, y, radio, color='green', anchor=None)[source]
Bases:
object
Oval or circle
- class pyworkflow.gui.canvas.Rectangle(canvas, x, y, width, height=None, color='green', anchor=None)[source]
Bases:
object
- class pyworkflow.gui.canvas.RoundConnector(canvas, x, y, name, fillColor='blue', outline='black')[source]
Bases:
ColoredConnector
- radius = 3
- class pyworkflow.gui.canvas.RoundedTextBox(canvas, text, x, y, bgColor, textColor='black')[source]
Bases:
TextItem
- class pyworkflow.gui.canvas.SquareConnector(canvas, x, y, name, fillColor='blue', outline='black')[source]
Bases:
ColoredConnector
- halfside = 3
- class pyworkflow.gui.canvas.TextBox(canvas, text, x, y, bgColor, textColor='black')[source]
Bases:
TextItem
- class pyworkflow.gui.canvas.TextCircle(canvas, text, x, y, bgColor, textColor='black')[source]
Bases:
TextItem