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


Groups > comp.lang.python > #10917 > unrolled thread

Table Driven GUI Definition?

Started byTim Daneliuk <tundra@tundraware.com>
First post2011-08-05 12:53 -0500
Last post2011-08-05 23:49 -0700
Articles 10 — 5 participants

Back to article view | Back to comp.lang.python


Contents

  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

#10917 — Table Driven GUI Definition?

FromTim Daneliuk <tundra@tundraware.com>
Date2011-08-05 12:53 -0500
SubjectTable Driven GUI Definition?
Message-ID<f9ntg8-735.ln1@ozzie.tundraware.com>
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?
-- 
------------------------------------------------------------------------
Tim Daneliuk
tundra@tundraware.com

[toc] | [next] | [standalone]


#10922

FromIrmen de Jong <irmen@-NOSPAM-xs4all.nl>
Date2011-08-05 21:05 +0200
Message-ID<4e3c3eee$0$23931$e4fe514c@news2.news.xs4all.nl>
In reply to#10917
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?

Yeah, HTML being the text file and a web browser being the tool to 
transform it into a GUI...

You can hook this up with a simple web server or web framework running 
locally to grab the submitted form results when the form is complete and 
process them in a piece of python code.

Wouldn't that work?


Irmen

[toc] | [prev] | [next] | [standalone]


#10925

FromTim Daneliuk <tundra@tundraware.com>
Date2011-08-05 15:10 -0500
Message-ID<u9vtg8-u57.ln1@ozzie.tundraware.com>
In reply to#10922
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?
> 
> Yeah, HTML being the text file and a web browser being the tool to transform it into a GUI...
> 
> You can hook this up with a simple web server or web framework running locally to grab the submitted form results when the form is complete and process them in a piece of python code.
> 
> Wouldn't that work?
> 
> 
> Irmen

Yup, although I'd probably use a central apache instance.  But
I'm still curious ... is there a way to do this with a full
GUI tool on a thick client?


-- 
------------------------------------------------------------------------
Tim Daneliuk
tundra@tundraware.com

[toc] | [prev] | [next] | [standalone]


#10930

FromPhilip Semanchuk <philip@semanchuk.com>
Date2011-08-05 16:42 -0400
Message-ID<mailman.1943.1312576961.1164.python-list@python.org>
In reply to#10925
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



>> 
>> Yeah, HTML being the text file and a web browser being the tool to transform it into a GUI...
>> 
>> You can hook this up with a simple web server or web framework running locally to grab the submitted form results when the form is complete and process them in a piece of python code.
>> 
>> Wouldn't that work?
>> 
>> 
>> Irmen
> 
> Yup, although I'd probably use a central apache instance.  But
> I'm still curious ... is there a way to do this with a full
> GUI tool on a thick client?
> 
> 
> -- 
> ------------------------------------------------------------------------
> Tim Daneliuk
> tundra@tundraware.com
> -- 
> http://mail.python.org/mailman/listinfo/python-list

[toc] | [prev] | [next] | [standalone]


#10939

FromTim Daneliuk <tundra@tundraware.com>
Date2011-08-05 17:20 -0500
Message-ID<4E3C6CA0.2000706@tundraware.com>
In reply to#10930
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.

Appearance isn't terribly important.  I want a "Quick-And-Dirty" configuration
manager interface (for configuring new operating system VMs).  The reason
that I want a simple text file definition is to make it easy to add new
options to the display as they become available.  For example, suppose
it becomes possible to work with a new OS, then all I'd have to do is
add the following to the text definition file, and regenerate the interface:

   Checkbox      "MVS Compatibility Services"

The idea is to not have to touch the code base as the options of the GUI
evolve, but rather to modify the data file that describes it.  In some sense,
this is a variation of HTML templating except I want to do it (potentially)
with a thick client GUI.

[toc] | [prev] | [next] | [standalone]


#10942

FromPhilip Semanchuk <philip@semanchuk.com>
Date2011-08-05 18:51 -0400
Message-ID<mailman.1953.1312584701.1164.python-list@python.org>
In reply to#10939
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

[toc] | [prev] | [next] | [standalone]


#10944

FromTim Daneliuk <tundra@tundraware.com>
Date2011-08-05 18:57 -0500
Message-ID<vkcug8-k7a.ln1@ozzie.tundraware.com>
In reply to#10942
On 8/5/2011 5:51 PM, Philip Semanchuk wrote:
>
> 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
>

Something like this is more what I had in mind (but this seems to
not be actively supported????):

     http://pythoncard.sourceforge.net/documentation.html

[toc] | [prev] | [next] | [standalone]


#10941

FromTim Daneliuk <tundra@tundraware.com>
Date2011-08-05 17:20 -0500
Message-ID<mailman.1952.1312583600.1164.python-list@python.org>
In reply to#10930
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.

Appearance isn't terribly important.  I want a "Quick-And-Dirty" configuration
manager interface (for configuring new operating system VMs).  The reason
that I want a simple text file definition is to make it easy to add new
options to the display as they become available.  For example, suppose
it becomes possible to work with a new OS, then all I'd have to do is
add the following to the text definition file, and regenerate the interface:

   Checkbox      "MVS Compatibility Services"

The idea is to not have to touch the code base as the options of the GUI
evolve, but rather to modify the data file that describes it.  In some sense,
this is a variation of HTML templating except I want to do it (potentially)
with a thick client GUI.

[toc] | [prev] | [next] | [standalone]


#10926

FromEmile van Sebille <emile@fenx.com>
Date2011-08-05 13:16 -0700
Message-ID<mailman.1939.1312575609.1164.python-list@python.org>
In reply to#10917
On 8/5/2011 10:53 AM Tim Daneliuk said...
> 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.

I'm not happened across an automated tool exactly, but I'd look into 
pyjamas or pygui.

Emile

[toc] | [prev] | [next] | [standalone]


#10956

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2011-08-05 23:49 -0700
Message-ID<mailman.1960.1312613385.1164.python-list@python.org>
In reply to#10917
4On Fri, 05 Aug 2011 12:53:19 -0500, Tim Daneliuk
<tundra@tundraware.com> declaimed the following in
gmane.comp.python.general:

>            Windows Compatibility Services  _
>            Linux Compatibility Services    _
>            TRS-DOS Compatibility Services  _
>
	What version of TRS-DOS (pre LS-DOS (aka TRS-DOS 6)?)

	Don't answer -- rhetorical question (my TRS-80 Model III/4 is in
storage, I expect if I boot it, the head on the floppy will crack off
<G>)

> 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.
>
	Unlikely -- you'd have to have a library that incorporated all
possible targets... Or, at least, could load the most common tool-kit
for each.

	An old book, "The Viewport Technician", did cover how to code for:
Apple II-GS, Amiga, Macintosh, Windows (3), and GEM.

	Simplest would be a curses style text interface -- but I don't know
if Windows console is compatible (another book I own, strangely bought
in the late 80s early 90s, is completely concerned with text displays
and an assumption that text background could be locked so tabbing
between fields was possible... Features I've only seen on terminal
specific code [my college Hazeltine 2000 terminals, and a library linked
to the COBOL runtime; and DEC FMS {Form Management System} on VT-100 and
later])
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web