free software resistance

 the cost of computing freedom is eternal vigilance

### tk.py *originally posted:* may 2025 this is a project to recreate and zero-clause bsd license the gui code that she was built on top of, using pydocs (the gui, the text widget) and tutorials (the menu) without the gui code from she. lines i figured out and added to she (which ultimately constitutes most of the code, but not the original gui used) will be included, such as the line to change the background colour. this will make it possible for me to re-license the bulk of the code, which i am the author of, and create an updated version of she with a permissive license. im not against the gpl, i have tried adding it to some of my larger projects, but it has failed to do more good for my own purposes than a bsd/mit/isc style license. by the original authors admission, creating a gui using tkinter is a relatively trivial task. im not fond of the oop syntax typical of most guis (including curses) and i prefer the way this was done in the older versions of she, but based on the following code you can see that getting from a form with two buttons to a text editor with a menu does not take a very significant amount of code. ``` #!/usr/bin/pypy2 # coding: utf-8 # 2020, 2021, 2022, 2024, 2025 by mn # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. proginf = "tkinter text form 0.1, may 2025 mn" notes = """ the purpose of this program is to initialise / use a text widget without the code originally used to create the she editor. code added by the author to she will be used, while gpl code from other authors will be avoided. she was built by a single author, after adapting an existing gpl-licensed editor. the goal is to recreate that editor using pydocs and tutorials, so the remaining code from she can be added and then re-licensed by the author. sync ; ./tk.py & """ from Tkinter import * class Application(Frame): def ctrlq(self, *args): root.destroy() def ctrlt(self, *args): nl = chr(10) self.textarea.insert(1.0, "hello" + " " + nl) def controls(self): self.menus = Menu(self) root.config(menu=self.menus) file_menu = Menu(self.menus) file_menu.add_command(label='quit', command=root.destroy) self.menus.add_cascade(label="file", menu=file_menu) about_menu = Menu(self.menus) about_menu.add_command(label='about', command=self.ctrlt) self.menus.add_cascade(label="about", menu=about_menu) self.textarea = Text(self, wrap=WORD) self.textarea.configure(font = ("monospace", 16), bg = "#e7e7e7") self.textarea.pack({"side": "left", "fill": "both", "expand": "true"}) self.textarea.bind('<' + 'Control-t>', self.ctrlt) self.textarea.bind('<' + 'Control-q>', self.ctrlq) def __init__(self, master = None): Frame.__init__(self, master) self.pack({"side": "left", "fill": "both", "expand": "true"}) self.controls() root.title('tkinter') root = Tk() app = Application(master = root) app.mainloop() root.destroy() ``` license: 0-clause bsd ``` # 2018, 2019, 2020, 2021, 2022, 2024, 2025 # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ``` => https://freesoftwareresistance.neocities.org