def _set_path_elements(self, ycoord=None): self.remove_all_elements() i = 0 for s in self._path_list: e = Clickable(s) e.set_style("text") e.normal_params.params["font_size"] = style.PATH_FONT_SIZE e.press_params.params["font_size"] = style.PATH_FONT_SIZE e.finish() e.user_func = self._reaction_path e.user_params = {"n": i} e.set_jailed(self.father) ## e._lock_jail = True #so that in the future jail will always stay self.father self.add_elements([e]) i += 1 father = self if self.father.is_finished(): father = self.father fr = father.get_storer_rect() wtot = h_store(fr, self._elements, gap=0, xstart="auto", ycoord=ycoord) if wtot > fr.width: h_store(fr, self._elements, gap=0, ycoord=ycoord, xstart=fr.right - wtot - 2) self._n = len(self._elements)
def _get_name_element(self, name): painter = functions.obtain_valid_painter(painterstyle.NAME_PAINTER, size=style.SIZE) el = Clickable(name) el.set_painter(painter) el.set_style(style.STYLE_NAME) el.finish() return el
def _get_name_element(self, name): painter = functions.obtain_valid_painter(painterstyle.NAME_PAINTER, size=style.SIZE) el = Clickable(name) el.set_painter(painter) el.set_style(style.STYLE_NAME) el.finish() return el
def _get_name_element(self, name, namestyle): painter = functions.obtain_valid_painter( painterstyle.INSERTER_NAME_PAINTER, size=style.SIZE) el = Clickable(name, finish=False) el.set_painter(painter) if namestyle: el.set_style(namestyle) el.finish() return el
def get_launcher_element(self, name): size = (style.SIZE[0], style.Y_SMALL_SIZE) painter = functions.obtain_valid_painter( painterstyle.BROWSER_LAUNCHER_PAINTER, size=size) el = Clickable(name) el.set_painter(painter) el.set_style(style.STYLE_BROWSER_LAUNCHER) el.finish() return el
def get_launcher_element(self, name): size = (style.SIZE[0], style.Y_SMALL_SIZE) painter = functions.obtain_valid_painter( painterstyle.BROWSER_LAUNCHER_PAINTER, size=size) el = Clickable(name) el.set_painter(painter) el.set_style(style.STYLE_BROWSER_LAUNCHER) el.finish() return el
def _set_path_elements(self, ycoord=None): self.remove_all_elements() i = 0 for s in self._path_list: e = Clickable(s) e.set_style("text") e.normal_params.params["font_size"] = style.PATH_FONT_SIZE e.press_params.params["font_size"] = style.PATH_FONT_SIZE e.finish() e.user_func = self._reaction_path e.user_params = {"n" : i} e.set_jailed(self.father) ## e._lock_jail = True #so that in the future jail will always stay self.father self.add_elements([e]) i += 1 father = self if self.father.is_finished(): father = self.father fr = father.get_storer_rect() wtot = h_store(fr, self._elements, gap=0, xstart="auto", ycoord=ycoord) if wtot > fr.width: h_store(fr, self._elements, gap=0, ycoord=ycoord, xstart=fr.right - wtot-2) self._n = len(self._elements)