Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10942

Re: Table Driven GUI Definition?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <philip@semanchuk.com>
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; 'escape': 0.04; 'whatever.': 0.07; 'wxpython': 0.07; 'python': 0.08; '>>>>': 0.09; 'oh,': 0.09; 'solution,': 0.09; 'tags,': 0.09; 'interfaces': 0.12; 'gui': 0.13; '"windows': 0.16; 'anyone?': 0.16; 'cares': 0.16; 'checkbox': 0.16; 'clear.': 0.16; 'cygwin,': 0.16; 'input.': 0.16; 'osx': 0.16; 'received:mindspring.com': 0.16; 'see.': 0.16; 'semanchuk': 0.16; 'subject:GUI': 0.16; 'templating': 0.16; 'tkinter,': 0.16; 'x-mailer:apple mail (2.1084)': 0.16; 'this:': 0.16; 'wrote:': 0.16; 'solution.': 0.17; 'linux': 0.17; '>>>': 0.18; 'appropriate.': 0.18; 'template': 0.19; 'seems': 0.20; 'bonus': 0.21; 'maybe': 0.21; "doesn't": 0.22; 'stuff': 0.22; 'header:In-Reply-To:1': 0.22; 'cheers': 0.23; 'interface': 0.23; '(or': 0.23; 'builds': 0.23; "user's": 0.23; 'pm,': 0.24; 'aug': 0.24; 'code': 0.25; 'xml': 0.25; 'code.': 0.26; 'windows': 0.26; "i'm": 0.27; 'skip:_ 20': 0.28; 'separate': 0.28; 'described': 0.28; 'problem': 0.28; 'looks': 0.29; 'definition': 0.30; 'environment.': 0.30; 'times.': 0.30; 'solved': 0.30; 'toolkit': 0.30; 'installation': 0.30; 'equivalent': 0.31; 'subject:?': 0.31; "didn't": 0.31; 'seem': 0.31; 'adds': 0.32; 'words,': 0.32; 'received:24': 0.32; 'this.': 0.32; 'does': 0.32; 'agree': 0.33; "what's": 0.33; 'actually': 0.33; 'there': 0.33; 'to:addr:python- list': 0.33; "i've": 0.34; 'points': 0.34; 'someone': 0.34; 'describe': 0.34; 'realize': 0.34; 'idea': 0.34; 'engine,': 0.34; 'like:': 0.34; 'options:': 0.34; 'pretty': 0.35; 'similar': 0.35; 'record': 0.35; 'charset:us-ascii': 0.36; 'problem.': 0.36; 'connection': 0.36; 'file': 0.36; 'page.': 0.36; 'model': 0.37; 'run': 0.37; 'but': 0.37; 'page': 0.37; 'something': 0.37; 'presentation': 0.38; 'could': 0.38; 'some': 0.38; 'should': 0.38; 'subject:: ': 0.39; 'window': 0.39; 'option': 0.39; 'header:Mime- Version:1': 0.39; 'else': 0.39; 'basic': 0.39; 'missing': 0.39; 'selection': 0.39; 'to:addr:python.org': 0.39; 'might': 0.40; "it's": 0.40; 'where': 0.40; 'more': 0.60; 'your': 0.61; 'hope': 0.61; 'basis': 0.61; 'kind': 0.61; 'header:Message-Id:1': 0.61; 'services': 0.62; 'further': 0.64; 'act': 0.65; '"what': 0.67; 'selected': 0.68; 'care': 0.71; 'me;': 0.84; 'received:69.73': 0.84; 'something.': 0.84; 'thereafter,': 0.84
Content-Type text/plain; charset=us-ascii
Mime-Version 1.0 (Apple Message framework v1084)
Subject Re: Table Driven GUI Definition?
From Philip Semanchuk <philip@semanchuk.com>
In-Reply-To <4E3C6CA0.2000706@tundraware.com>
Date Fri, 5 Aug 2011 18:51:36 -0400
Content-Transfer-Encoding quoted-printable
References <f9ntg8-735.ln1@ozzie.tundraware.com> <4e3c3eee$0$23931$e4fe514c@news2.news.xs4all.nl> <u9vtg8-u57.ln1@ozzie.tundraware.com> <mailman.1943.1312576961.1164.python-list@python.org> <4E3C6CA0.2000706@tundraware.com>
To Lista-Comp-Lang-Python list <python-list@python.org>
X-Mailer Apple Mail (2.1084)
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - deimos.nocdirect.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - semanchuk.com
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1953.1312584701.1164.python-list@python.org> (permalink)
Lines 84
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1312584701 news.xs4all.nl 23852 [2001:888:2000:d::a6]:60107
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:10942

Show key headers only | View raw


On Aug 5, 2011, at 6:20 PM, Tim Daneliuk wrote:

> On 8/5/2011 3:42 PM, Philip Semanchuk wrote:
>> 
>> On Aug 5, 2011, at 4:10 PM, Tim Daneliuk wrote:
>> 
>>> On 8/5/2011 2:05 PM, Irmen de Jong said this:
>>>> On 05-08-11 19:53, Tim Daneliuk wrote:
>>>>> I have a task where I want to create pretty simple one page visual
>>>>> interfaces (Graphical or Text, but it needs to run across Windows,
>>>>> Cygwin, Linux,*BSD, OSX ...).  These interfaces are nothing more
>>>>> than option checklists and text fields.  Conceptually something like:
>>>>> 
>>>>>                 Please Select Your Installation Options:
>>>>> 
>>>>>            Windows Compatibility Services  _
>>>>>            Linux Compatibility Services    _
>>>>>            TRS-DOS Compatibility Services  _
>>>>> 
>>>>>            What Is Your email Address:     _______________________
>>>>> 
>>>>> What I'm looking for is a way to describe such forms in a text
>>>>> file that can then be fed into a tool to generate the necessary
>>>>> pyGUI, Tkinter, (or whatever) code.   The idea is that it should
>>>>> be simple to generate a basic interface like this and have it
>>>>> only record the user's input.  Thereafter, the python code
>>>>> would act on the basis of those selection without any further
>>>>> connection to the GUI.
>>>>> 
>>>>> An added bonus would be a similar kind of thing for generating
>>>>> web interfaces to do this.  This might actually be a better model
>>>>> because then I only have to worry about a single presentation
>>>>> environment.
>>>>> 
>>>>> Ideas anyone?
>> 
>> Hi Tim
>> This looks pretty straightforward to me; maybe I'm missing something. It doesn't look trivial, but the steps seem pretty clear. Is there some part in particular that's giving you trouble?
>> 
>> Cheers
>> Philip
>> 
> 
> I want to take a text definition file that looks something this:
> 
>  Title         "Please Select Your Installation Options:"
> 
> 
>  Checkbox      "Windows Compatibility Services"
>  Checkbox      "Linux Compatibility Services"
>  Checkbox      "TRS-DOS Compatibility Services"
> 
>  Inputbox       "What Is Your email Address:"
> 
> 
> And have that aut-generate the GUI interface described above for the
> selected GUI toolkit and/or an equivalent HTML page.
> 
> I know I can write a program to do this, but it seems that someone else
> may have already solved this problem.

Oh, I see. I didn't realize you were looking for a most canned solution. I agree that it's a problem that's been solved many times.

I've used Mako before as an HTML templating engine, but ISTR that it points out that it's agnostic to what it's templating. In other words, it only cares about what's between the Mako escape tags, it doesn't care if the surrounding text is HTML or XML or Python or whatever. 

So you could have a Mako template that consists mostly of Python code that builds a wxPython window (if wxPython is your cup of tea) and then some Mako commands in the middle that reads your text definition file and adds checkboxes, textboxes, etc. as appropriate. It's not a canned solution, but it does allow you to separate the boilerplate stuff from the variants.

Hope this helps
Philip

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Table Driven GUI Definition? Tim Daneliuk <tundra@tundraware.com> - 2011-08-05 12:53 -0500
  Re: Table Driven GUI Definition? Irmen de Jong <irmen@-NOSPAM-xs4all.nl> - 2011-08-05 21:05 +0200
    Re: Table Driven GUI Definition? Tim Daneliuk <tundra@tundraware.com> - 2011-08-05 15:10 -0500
      Re: Table Driven GUI Definition? Philip Semanchuk <philip@semanchuk.com> - 2011-08-05 16:42 -0400
        Re: Table Driven GUI Definition? Tim Daneliuk <tundra@tundraware.com> - 2011-08-05 17:20 -0500
          Re: Table Driven GUI Definition? Philip Semanchuk <philip@semanchuk.com> - 2011-08-05 18:51 -0400
            Re: Table Driven GUI Definition? Tim Daneliuk <tundra@tundraware.com> - 2011-08-05 18:57 -0500
        Re: Table Driven GUI Definition? Tim Daneliuk <tundra@tundraware.com> - 2011-08-05 17:20 -0500
  Re: Table Driven GUI Definition? Emile van Sebille <emile@fenx.com> - 2011-08-05 13:16 -0700
  Re: Table Driven GUI Definition? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-08-05 23:49 -0700

csiph-web