Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'yet.': 0.04; 'root': 0.05; 'subject:Python': 0.06; 'filename:fname piece:py': 0.07; 'importerror:': 0.07; 'linux,': 0.07; 'sys': 0.07; 'tkinter': 0.07; 'exist,': 0.09; 'i\xe2\x80\x99ve': 0.09; 'tcl/tk': 0.09; 'try:': 0.09; 'def': 0.12; '24,': 0.16; 'bread,': 0.16; 'compatible,': 0.16; 'example)': 0.16; 'indexerror:': 0.16; 'once.': 0.16; 'self.root': 0.16; 'sliced': 0.16; 'subject:GUI': 0.16; 'subject:desktop': 0.16; 'tcl': 0.16; 'tix': 0.16; 'tk.': 0.16; 'url:linux': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'app': 0.19; '(but': 0.19; 'small,': 0.19; 'thu,': 0.19; 'widget': 0.19; 'working.': 0.19; 'later': 0.20; 'import': 0.22; 'saying': 0.22; 'to:name:python-list@python.org': 0.22; 'fairly': 0.24; "haven't": 0.24; 'script': 0.25; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'chris': 0.29; '[1]': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'work.': 0.31; '(which': 0.31; 'gives': 0.31; 'subject:next': 0.31; 'though.': 0.31; 'anyone': 0.31; 'class': 0.32; 'probably': 0.32; 'option': 0.32; 'quite': 0.32; 'linux': 0.33; 'everyone': 0.33; 'projects.': 0.33; 'skip:_ 10': 0.34; "can't": 0.35; 'agree': 0.35; 'except': 0.35; 'skip:s 30': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'charset:us-ascii': 0.36; 'should': 0.36; 'two': 0.37; 'list': 0.37; 'button': 0.38; 'gmail': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'anything': 0.39; 'though,': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'how': 0.40; 'results.': 0.60; 'tell': 0.60; 'complete': 0.62; 'such': 0.63; 'myself': 0.63; 'choose': 0.64; 'provide': 0.64; 'more': 0.64; 'skip:\xe2 10': 0.65; 'world': 0.66; 'it!': 0.67; 'results': 0.69; '8bit%:43': 0.74; 'jul': 0.74; 'url:search': 0.81; '2:02': 0.84; 'browsers,': 0.84; 'subject:Project': 0.84; 'ugly,': 0.84; 'don\xe2\x80\x99t': 0.91; 'hate': 0.91; 'url:tk': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=DThIaLOISfLAg8zVlfrrgWuPQG8J/F5VUlhPoARtUtA=; b=KVgVKAtieO/GLRnqcGglj5ONcVobRR+CFSMxYMkHksP/TQ8Y0TFIzusBovrNJ2Ugd9 oAmIzZ0W57GslZJo6UvJ6UXj2CDH9c4gVdKYhKvGVz01j0euMKPeS/uXKXs9Ipugx4Ek C0jNy/fuRi82jLphNzieL6i0mdDXyrQziDb1ZEywgBduuYi0q+3B9Y+6lX+uGGQyTgCP eW6X+h843zf1YG0/kHygqmRP3aS57Bm3djzyCHb0dLPnUil4DuB77IPzdEnIU/hpdZAd wnRI3M5evZGavuJtH/Sr1CBtMGzFmBgxQo8CLceYjmhhx8n77UUYxhkxfFwxXlu6jlYz cjJg== X-Received: by 10.60.103.195 with SMTP id fy3mr2372620oeb.35.1406232842434; Thu, 24 Jul 2014 13:14:02 -0700 (PDT) MIME-Version: 1.0 Sender: zachary.ware@gmail.com In-Reply-To: References: <93c42547-557b-4839-baba-9ed54120595e@googlegroups.com> From: Zachary Ware Date: Thu, 24 Jul 2014 15:13:42 -0500 X-Google-Sender-Auth: 1wlIqrq2AIbdkGYttDzmZAocL8w Subject: Re: Exploring Python for next desktop GUI Project To: "python-list@python.org" Content-Type: multipart/mixed; boundary=089e01182c0a0b8ce604fef6198d X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 166 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1406232850 news.xs4all.nl 2888 [2001:888:2000:d::a6]:51771 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75176 --089e01182c0a0b8ce604fef6198d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Jul 24, 2014 at 2:02 PM, Chris =E2=80=9CKwpolska=E2=80=9D Warrick wrote: > Pretty much everyone in the world hates Tcl and Tk. Ask your favorite > search engine for some results. Whee, I'm an alien! ;) I'm not saying Tk is the best thing since sliced bread, I just don't see what so many people seem to hate about it. > i=E2=80=99ve tried to write a Tkinter thing once. I don=E2=80=99t have a= copy anymore > (consciously deleted), but I vaguely remember some issues with widgets > that do not work. I also remember that the list of widgets is quite > small and not enough for many projects. I have had no issues with widgets not working. I will admit that the widget set is fairly small, though. You can get more from Tix (which is also distributed with tkinter), but I haven't had any need for that yet. > The best way to handle this is just choose one of the two (wxwidgets > chose GTK 2, for example) and be considered native enough by most, as > people don=E2=80=99t really mind mixing them (as there are no good Qt web > browsers, and VLC uses Qt and not GTK) That's fair, and I agree that Tk should probably provide "close to GTK" and "close to QT" themes for ttk[1]. As I understand it, though, ttk gives almost complete control over the look of individual widgets, so if you really don't like how your widget looks, change it! > ttk on Linux doesn=E2=80=99t change a thing. It still uses the ugly, anc= ient, > motif-esque style: > > https://www.google.com/search?q=3Dtk+linux&tbm=3Disch > > (also, off by 10 years, motif is actually from the 1980s.) Motif is indeed ugly, but your search for 'tk linux' doesn't tell me anything about 'ttk linux'. I would be interested in the results of the script below on Linux, which I may or may not be able to try for myself later (but can't right now). --=20 Zach [1] Such themes might already exist, I haven't checked. If anyone wants to see what themes are available and how they look, try this (2/3 compatible, also attached in case Gmail messes it up): import sys try: import tkinter as tk from tkinter import ttk except ImportError: import Tkinter as tk import ttk class App(object): def __init__(self, root): self.root =3D root self.root.title('Theme tester') self.info_label =3D ttk.Label(self.root, text=3D"Python {}.{} with Tcl/Tk {} on {}".format( sys.version_info[0], sys.version_info[1], self.root.tk.eval('info patchlevel'), sys.platform)) self.info_label.pack() self.theme_idx =3D 0 self.change_btn =3D ttk.Button(self.root, text=3D'Change theme', command=3Dself.change_theme ) self.change_btn.pack() self.rb_var =3D tk.StringVar(self.root) self.radiobtn =3D ttk.Radiobutton(self.root, text=3D'Radio button option 1', variable=3Dself.rb_var, value=3D'1') self.radiobtn.pack() self.radiobtn2 =3D ttk.Radiobutton(self.root, text=3D'Radio button option 2', variable=3Dself.rb_var, value=3D'2') self.radiobtn2.pack() self.checkbtn =3D ttk.Checkbutton(self.root, text=3D'Checkbutton') self.checkbtn.pack() self.entry =3D ttk.Entry(self.root) self.entry.insert(0, 'Entry') self.entry.pack() self.style =3D ttk.Style(self.root) self.available_themes =3D self.style.theme_names() self.theme_label =3D ttk.Label(self.root, text=3D'Platform default'= ) self.theme_label.pack() def change_theme(self): try: theme =3D self.available_themes[self.theme_idx] except IndexError: theme =3D self.available_themes[0] self.theme_idx =3D 0 self.style.theme_use(theme) self.theme_label.configure(text=3Dtheme) self.theme_idx +=3D 1 root =3D tk.Tk() app =3D App(root) root.mainloop() --089e01182c0a0b8ce604fef6198d Content-Type: text/x-python; charset=US-ASCII; name="tk_themes.py" Content-Disposition: attachment; filename="tk_themes.py" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hy0i99lb0 aW1wb3J0IHN5cw0KDQp0cnk6DQogICAgaW1wb3J0IHRraW50ZXIgYXMgdGsNCiAgICBmcm9tIHRr aW50ZXIgaW1wb3J0IHR0aw0KZXhjZXB0IEltcG9ydEVycm9yOg0KICAgIGltcG9ydCBUa2ludGVy IGFzIHRrDQogICAgaW1wb3J0IHR0aw0KDQpjbGFzcyBBcHA6DQogICAgZGVmIF9faW5pdF9fKHNl bGYsIHJvb3QpOg0KICAgICAgICBzZWxmLnJvb3QgPSByb290DQogICAgICAgIHNlbGYucm9vdC50 aXRsZSgnVGhlbWUgdGVzdGVyJykNCiAgICAgICAgc2VsZi5pbmZvX2xhYmVsID0gdHRrLkxhYmVs KHNlbGYucm9vdCwNCiAgICAgICAgICAgIHRleHQ9IlB5dGhvbiB7fS57fSB3aXRoIFRjbC9UayB7 fSBvbiB7fSIuZm9ybWF0KA0KICAgICAgICAgICAgICAgIHN5cy52ZXJzaW9uX2luZm9bMF0sIHN5 cy52ZXJzaW9uX2luZm9bMV0sDQogICAgICAgICAgICAgICAgc2VsZi5yb290LnRrLmV2YWwoJ2lu Zm8gcGF0Y2hsZXZlbCcpLA0KICAgICAgICAgICAgICAgIHN5cy5wbGF0Zm9ybSkpDQogICAgICAg IHNlbGYuaW5mb19sYWJlbC5wYWNrKCkNCiAgICAgICAgc2VsZi50aGVtZV9pZHggPSAwDQogICAg ICAgIHNlbGYuY2hhbmdlX2J0biA9IHR0ay5CdXR0b24oc2VsZi5yb290LA0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHRleHQ9J0NoYW5nZSB0aGVtZScsDQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbWFuZD1zZWxmLmNoYW5nZV90aGVtZQ0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkNCiAgICAgICAgc2VsZi5jaGFuZ2Vf YnRuLnBhY2soKQ0KICAgICAgICBzZWxmLnJiX3ZhciA9IHRrLlN0cmluZ1ZhcihzZWxmLnJvb3Qp DQogICAgICAgIHNlbGYucmFkaW9idG4gPSB0dGsuUmFkaW9idXR0b24oc2VsZi5yb290LA0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHQ9J1JhZGlvIGJ1dHRvbiBv cHRpb24gMScsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyaWFi bGU9c2VsZi5yYl92YXIsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dmFsdWU9JzEnKQ0KICAgICAgICBzZWxmLnJhZGlvYnRuLnBhY2soKQ0KICAgICAgICBzZWxmLnJh ZGlvYnRuMiA9IHR0ay5SYWRpb2J1dHRvbihzZWxmLnJvb3QsDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHRleHQ9J1JhZGlvIGJ1dHRvbiBvcHRpb24gMicsDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhcmlhYmxlPXNlbGYucmJfdmFy LA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZT0nMicpDQog ICAgICAgIHNlbGYucmFkaW9idG4yLnBhY2soKQ0KICAgICAgICBzZWxmLmNoZWNrYnRuID0gdHRr LkNoZWNrYnV0dG9uKHNlbGYucm9vdCwgdGV4dD0nQ2hlY2tidXR0b24nKQ0KICAgICAgICBzZWxm LmNoZWNrYnRuLnBhY2soKQ0KICAgICAgICBzZWxmLmVudHJ5ID0gdHRrLkVudHJ5KHNlbGYucm9v dCkNCiAgICAgICAgc2VsZi5lbnRyeS5pbnNlcnQoMCwgJ0VudHJ5JykNCiAgICAgICAgc2VsZi5l bnRyeS5wYWNrKCkNCg0KICAgICAgICBzZWxmLnN0eWxlID0gdHRrLlN0eWxlKHNlbGYucm9vdCkN CiAgICAgICAgc2VsZi5hdmFpbGFibGVfdGhlbWVzID0gc2VsZi5zdHlsZS50aGVtZV9uYW1lcygp DQoNCiAgICAgICAgc2VsZi50aGVtZV9sYWJlbCA9IHR0ay5MYWJlbChzZWxmLnJvb3QsIHRleHQ9 J1BsYXRmb3JtIGRlZmF1bHQnKQ0KICAgICAgICBzZWxmLnRoZW1lX2xhYmVsLnBhY2soKQ0KDQog ICAgZGVmIGNoYW5nZV90aGVtZShzZWxmKToNCiAgICAgICAgdHJ5Og0KICAgICAgICAgICAgdGhl bWUgPSBzZWxmLmF2YWlsYWJsZV90aGVtZXNbc2VsZi50aGVtZV9pZHhdDQogICAgICAgIGV4Y2Vw dCBJbmRleEVycm9yOg0KICAgICAgICAgICAgdGhlbWUgPSBzZWxmLmF2YWlsYWJsZV90aGVtZXNb MF0NCiAgICAgICAgICAgIHNlbGYudGhlbWVfaWR4ID0gMA0KICAgICAgICBzZWxmLnN0eWxlLnRo ZW1lX3VzZSh0aGVtZSkNCiAgICAgICAgc2VsZi50aGVtZV9sYWJlbC5jb25maWd1cmUodGV4dD10 aGVtZSkNCg0KICAgICAgICBzZWxmLnRoZW1lX2lkeCArPSAxDQoNCnJvb3QgPSB0ay5UaygpDQph cHAgPSBBcHAocm9vdCkNCnJvb3QubWFpbmxvb3AoKQ0K --089e01182c0a0b8ce604fef6198d--