Exemplo n.º 1
0
    def _show_object_by_id(self, object_id, via_navigation=False):

        if self.winfo_ismapped() and self.object_id != object_id:
            if not via_navigation and self.object_id is not None:
                if self.object_id in self.back_links:
                    self.back_links.remove(self.object_id)
                self.back_links.append(self.object_id)
                del self.forward_links[:]

            self.object_id = object_id
            update_entry_text(self.id_entry, format_object_id(object_id))
            self.set_object_info(None)
            self.request_object_info()
Exemplo n.º 2
0
    def set_object_info(self, object_info):
        self.object_info = object_info
        if object_info is None:
            update_entry_text(self.repr_entry, "")
            update_entry_text(self.type_entry, "")
            self.grid_frame.grid_remove()
        else:
            update_entry_text(self.repr_entry, object_info["repr"])
            update_entry_text(self.type_entry, object_info["type"])
            self.attributes_frame.tree.configure(
                height=len(object_info["attributes"]))
            self.attributes_frame.update_variables(object_info["attributes"])
            self.update_type_specific_info(object_info)

            # update layout
            self._expose(None)
            if not self.grid_frame.winfo_ismapped():
                self.grid_frame.grid()

        if self.back_links == []:
            self.back_label.config(foreground="lightgray", cursor="arrow")
        else:
            self.back_label.config(foreground="blue", cursor="hand2")

        if self.forward_links == []:
            self.forward_label.config(foreground="lightgray", cursor="arrow")
        else:
            self.forward_label.config(foreground="blue", cursor="hand2")
Exemplo n.º 3
0
    def set_object_info(self, object_info):
        self.object_info = object_info
        if object_info is None:
            update_entry_text(self.repr_entry, "")
            update_entry_text(self.type_entry, "")
            "self.data_frame.child.grid_remove()"
        else:
            update_entry_text(self.repr_entry, object_info["repr"])
            update_entry_text(self.type_entry, object_info["type"])
            self.attributes_frame.tree.configure(
                height=len(object_info["attributes"]))
            self.attributes_frame.update_variables(object_info["attributes"])
            self.update_type_specific_info(object_info)

            # update layout
            #self._expose(None)
            #if not self.grid_frame.winfo_ismapped():
            #    self.grid_frame.grid()
        """