def __init__(self, parent, width, height, text1="", text2="", bg="white", fg="black", button=False, title=None, overrideredirect=False): Toplevel.__init__(self, parent) self.parent= parent self.wm_withdraw() self.configure(borderwidth=0) center_window(self, width, height, windowsbar=True) self.wm_title(title or 'Acerca de') self.parent.wm_attributes("-alpha", 0.9) self.parent.wm_attributes("-transparentcolor", "purple") self.create_widgets(text1, text2, bg, fg, overrideredirect, button) self.overrideredirect(overrideredirect) self.resizable(height=FALSE, width=FALSE) # don't allow resizing yet self.transient(self.parent) self.focus_set() self.protocol("WM_DELETE_WINDOW", self.exit) self.bind("<Return>", self.exit) self.bind("<Escape>", self.exit) # wait for window to be generated self.update() # now allow resizing self.resizable(height=TRUE, width=TRUE) self.wm_deiconify() self.grab_set()
AcercaDe(self.master, title=titulo, bg=self.BACKGROUND_LIGHT, fg=self.FOREGROUND_LIGHT, text1=titulo, text2=text, button=True, width=550, height=320, overrideredirect=True) def help(self, event=None): messagebox.showinfo("Ayuda", "Para cualquier ayuda escribir a: [email protected] ", icon='question') def exit_toolbox(self, event=None): self.toolbox.destroy() def exit_properties(self): self.properties.destroy() def exit(self): sys.exit() if __name__ == "__main__": root = Tk() root.wm_iconbitmap(r"images\Icon.ico") root.title("Simulador de redes") #root.overrideredirect(True) center_window(root, width=1200, height=660, windowsbar=True) app = GUI(root) bg = app.frame.config(bg=app.BACKGROUND_DARK) root['bg'] = bg root.mainloop()