Table Driven GUI Definition?

T

Tim Daneliuk

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?
 
I

Irmen de Jong

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
 
T

Tim Daneliuk

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?
 
E

Emile van Sebille

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
 
P

Philip Semanchuk

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
 
T

Tim Daneliuk

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.
 
T

Tim Daneliuk

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.
 
P

Philip Semanchuk

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
 
T

Tim Daneliuk

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
 
D

Dennis Lee Bieber

4On Fri, 05 Aug 2011 12:53:19 -0500, Tim Daneliuk
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
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])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,900
Latest member
Nell636132

Latest Threads

Top