def __init__(self, parent, title, msize, item): AbstractWindow.__init__(self, parent, title, msize) self.item = item header = Frame(self) header.pack(fill=X, expand=1, anchor=N) Button(header, text='Сохранить', command=lambda: self.save_notes()).pack(padx=10) self.t = Text(self) self.t.pack(padx=10, pady=10) self.t.insert('1.0', item.notes)
def __init__(self, parent, title, msize, items, switcher: bool, inv): AbstractWindow.__init__(self, parent, title, msize) self.s = switcher self.items = items self.inv = inv if switcher: Button(self, text='Создать вещь', command=self.add_item).pack(fill=X, anchor=NW, expand=1) Button(self, text='Создать хранилище', command=self.add_inventory).pack(fill=X, anchor=NE, expand=1) self.create_list()
def __init__(self, parent, title, geo, forbidden: list, maxparameters=999): AbstractWindow.__init__(self, parent, title, geo) self.maxparams = maxparameters self.forbidden_parameters = forbidden self.result = {} self.vars = {} self.rows = 0 self.create_add_parameter_button() self.parameter_frame = Frame(self) self.parameter_frame.pack(fill=BOTH, expand=1, padx=30, pady=10) self.create_confirm_profile_button() self.container = Frame(self) self.container.pack(fill=BOTH, expand=1, padx=15)
def __init__(self, parent, title: str, mgeo: tuple, name, core, automation: bool, **displayable): AbstractWindow.__init__(self, parent, title, mgeo) self.parameters = displayable self.row = 0 self.header = Frame(self) self.container = Frame(self) self.canvas = Canvas(self.container) self.frame_inside = Frame(self.canvas) self.scroller = Scrollbar(self, command=self.canvas.yview) self.header.pack(fill=X, padx=20) self.create_header(name, core) self.create_canvas() if automation: self.__iterate_strings()
def __init__(self, parent, inventory: Inventory, title='Общий инвентарь'): AbstractWindow.__init__(self, parent, title, (1000, 500)) self.show_about = Frame(self) self.list_frame = Frame(self) self.profile_items = inventory self.absolute_space = Label( self.list_frame, font=('Arial', 15, 'bold'), text= f'Заполнено: {self.profile_items.space - self.profile_items.get_abs_space()} /' f' {self.profile_items.space}') self.absolute_space.pack(expand=1, pady=10) self.scroll, self.list = self.create_listbox() self.list_frame.pack(side=LEFT, expand=1, fill=BOTH, padx=50, pady=50) self.active = None Button(self, text='Добавить вещь', command=self.add_item_request).pack(side=RIGHT, anchor=N, padx=10, pady=10) self.show_about.pack(side=RIGHT, expand=1, fill=BOTH, padx=20, pady=20) self.info, self.canvas = self.create_canvas()
def __init__(self, parent, title, inventory): AbstractWindow.__init__(self, parent, title, ('auto', )) self.all_items = inventory.inventory self.unselected_items = [x for x in inventory.inventory] self.selected_items = [] self.create_lists()