Browse Source

Add weight to point list widget.

master
Taylor Bockman 5 years ago
parent
commit
d764b35a69
  1. 3
      clusterview2/ui/mode_handlers.py
  2. 4
      clusterview2/ui/point_list_widget.py

3
clusterview2/ui/mode_handlers.py

@ -69,7 +69,7 @@ def refresh_point_list(ctx):
ctx.point_list_widget.clear()
for p in PointManager.point_set.points:
ctx.point_list_widget.addItem("({}, {})".format(p.x, p.y))
ctx.point_list_widget.addItem(f"({p.x}, {p.y}) | Weight: {p.weight}")
ctx.point_list_widget.update()
@ -148,6 +148,7 @@ def _handle_edit_point(ctx, event):
# Store old x, y from event
set_drawing_event(event)
ctx.update()
refresh_point_list(ctx)
def ogl_keypress_handler(ctx, event):

4
clusterview2/ui/point_list_widget.py

@ -17,7 +17,9 @@ def _string_point_to_point(str_point):
"""
# 1. Split
elems = str_point.split(",")
point_side = str_point.split("|")[0] # First element is the point
point_side = point_side.strip()
elems = point_side.split(",")
# 2. Take elements "(x" and "y)" and remove their first and
# last characters, respectively. Note that for y this

Loading…
Cancel
Save