diff --git a/painter.py b/painter.py index 1a28ebc..c841cbd 100644 --- a/painter.py +++ b/painter.py @@ -203,6 +203,9 @@ class Painter(Widget): self.draw() + # draw status bar + self.app.status_bar.draw() + # respond to drag def on_touch_move(self,touch): @@ -218,6 +221,9 @@ class Painter(Widget): # redraw self.draw() + # draw status bar + self.app.status_bar.draw() + # find the particle at position pos def find_particle(self,pos): diff --git a/status_bar.py b/status_bar.py index ee42a14..111ac76 100644 --- a/status_bar.py +++ b/status_bar.py @@ -39,5 +39,12 @@ class Status_bar(Label): if self.app.readonly: self.raw_text+=" [RO]" + # coordinates of selected cross + if len(self.app.painter.selected)>0: + # number of spaces to align right (use 13 characters to print position) + spaces=int(self.width/self.char_width)-len(self.raw_text)-13 + if spaces>0: + self.raw_text+=" "*spaces+"({:05.2f},{:05.2f})\n".format(self.app.painter.selected[0].squares[0].pos.x,self.app.painter.selected[0].squares[0].pos.y) + # do not wrap self.text=self.raw_text[:min(len(self.raw_text),int(self.width/self.char_width))]