Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'say,': 0.05; '(so': 0.07; 'subject:code': 0.07; 'latter': 0.09; 'subject:while': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'gui': 0.12; '"system': 0.16; '(it': 0.16; 'ah,': 0.16; 'alert': 0.16; 'exceptions,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'operation.': 0.16; 'patil': 0.16; 'subject:GUI': 0.16; 'system-wide': 0.16; 'wxpython': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'aug': 0.22; 'previously': 0.22; 'cc:addr:python.org': 0.22; 'instance,': 0.24; 'paul': 0.24; '(or': 0.24; 'cc:2**0': 0.24; 'sort': 0.25; 'logging': 0.26; 'purposes': 0.26; 'switch': 0.26; '(for': 0.26; 'header:In-Reply- To:1': 0.27; 'idea': 0.28; 'chris': 0.29; 'feature': 0.29; 'said,': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'asked': 0.31; 'code': 0.31; 'writes:': 0.31; 'critical': 0.32; 'linux': 0.33; 'cases': 0.33; 'fri,': 0.33; 'screen': 0.34; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'subject:one': 0.36; "didn't": 0.36; 'should': 0.36; 'example,': 0.37; 'two': 0.37; 'performance': 0.37; 'being': 0.38; 'window': 0.38; 'needed': 0.38; 'pm,': 0.38; 'resource': 0.38; 'that,': 0.38; 'short': 0.38; 'anything': 0.39; 'does': 0.39; 'extremely': 0.39; 'called': 0.40; 'most': 0.60; 'reserved': 0.61; 'simply': 0.61; 'times': 0.62; 'more': 0.64; 'great': 0.65; 'answer.': 0.68; 'messaging': 0.68; 'commercial': 0.71; 'programs,': 0.74; 'answer:': 0.84; 'subject:Keep': 0.84; 'absolutely': 0.87; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=WfIs1RRgSF2+e2Q0ucgwd/Mj8cyvZJQ0Z5If9z79muY=; b=lDvOlLDyqcWtJ1wVSMg2arPE+6x8ce5bd5CH/vrUaE3Emm8THPjQhviSsY57WligsB dwh34arWFB1bUXJzATOSSmUUJYfVg3Y3PN4lgYgfaxHng+5Ir6UGQ9jWFNZBUN/ie2iC lNICkEpM5o/s0b+z/M3zTsDGHBccPsDsl6QkVTPEdJepygCT6eJps/ZQuyTX08NJN2O3 W3q491R7DrpArFYddOEyXwY+XkS0n0NCSONEe5kIjvbphVA8uMHvVR9E+alDtzga49Jm RMTl5QyqNOx1YJF/bLnd8X8JPFeruAZh9jYOZeSEqAup6tLms0qB2t4Cx8PH+QGf0llk m46g== MIME-Version: 1.0 X-Received: by 10.50.66.197 with SMTP id h5mr3452184igt.34.1407490342793; Fri, 08 Aug 2014 02:32:22 -0700 (PDT) In-Reply-To: <85fvh7icj4.fsf@rudin.co.uk> References: <32f85c79-17a1-4d2f-a926-43812b8083ed@googlegroups.com> <85fvh7icj4.fsf@rudin.co.uk> Date: Fri, 8 Aug 2014 19:32:22 +1000 Subject: Re: Keep one GUI always on TOP while python code is running From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1407490345 news.xs4all.nl 2975 [2001:888:2000:d::a6]:41286 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75874 On Fri, Aug 8, 2014 at 6:57 PM, Paul Rudin wrote: > Chris Angelico writes: > >> On Fri, Aug 8, 2014 at 3:57 PM, Jaydeep Patil wrote: >>> I mean to say, One GUI should be always on top from start to end of code running. >>> So that user cant do any other operation. >>> I am using wxpython >> >> Ah, that would be called "System Modal", and should be reserved for >> absolutely critical system-wide alerts. It's also a feature that's >> simply not available to most user-space programs, and not available in >> most GUI toolkits. >> >> Short answer: Don't. > > There are commercial software packages that do this sort of > thing. Examsoft is one - the idea being that people can take exams > without access to other software at the same time (so that, for example, > they could look at previously prepared notes). Yeah; like I said, "Don't" is the short answer. There will be exceptions, some extremely rare situations when system modality is correct; but fundamentally, it's impossible to use GUI software to control what a person does with a computer (for instance, on all my Linux systems, I can hit Ctrl-Alt-F1 to switch away from the GUI altogether). So I'm dubious about its value for anything that isn't an absolutely critical alert. With the OS/2 Presentation Manager, I had SystemModal available as a window flag, and I used it for two purposes: an out-of-memory alert (or similarly critical resource shortage), and a pseudo-login screen (it just asked for a name, no password or anything, and it didn't change what you had access to - it was for the purposes of logging and messaging identification, nothing more); and the latter didn't really need to be system modal, it was just for convenience. If there's no way to make a wxpython window system modal, I would say it's no great loss. The chances of the feature being misused are extremely high; the cases where it's actually needed are extremely rare. Hence my short answer of "Don't"; honestly, there are more times when you need to optimize Python code for performance than there are times to create system modal windows. ChrisA