diff --git a/clusterview2/ui/mode_handlers.py b/clusterview2/ui/mode_handlers.py index 3240581..95ec445 100644 --- a/clusterview2/ui/mode_handlers.py +++ b/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): diff --git a/clusterview2/ui/point_list_widget.py b/clusterview2/ui/point_list_widget.py index 12ff331..b95ceae 100644 --- a/clusterview2/ui/point_list_widget.py +++ b/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