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


Groups > comp.lang.python > #64728

Re: Python declarative

Path csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'feedback.': 0.04; 'subject:Python': 0.06; 'label,': 0.09; 'lines.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'jan': 0.12; 'wrote': 0.14; '(it': 0.16; '24,': 0.16; 'aiming': 0.16; 'discussion.': 0.16; 'for,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'skip:n 70': 0.16; 'stuff.': 0.16; 'unlikely': 0.16; 'yet)': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'widget': 0.19; 'solution.': 0.20; 'example': 0.22; 'portion': 0.22; 'separate': 0.22; 'browsers': 0.24; 'first,': 0.26; 'header:X-Complaints-To:1': 0.27; 'respective': 0.29; 'xml': 0.29; 'designer': 0.30; 'see,': 0.30; 'skip:g 30': 0.30; 'claiming': 0.31; 'second,': 0.31; 'quite': 0.32; 'fri,': 0.33; 'period': 0.33; 'screen': 0.34; 'beyond': 0.35; 'definition': 0.35; 'one,': 0.35; 'but': 0.35; 'version': 0.36; 'achieving': 0.36; 'done': 0.36; 'shows': 0.36; 'thanks': 0.36; 'possible': 0.36; 'skip:- 20': 0.37; 'two': 0.37; 'needed': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'little': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'called': 0.40; 'release': 0.40; 'how': 0.40; 'even': 0.60; 'worry': 0.60; 'devices': 0.61; 'url:5': 0.61; 'took': 0.61; 'simple': 0.61; 'show': 0.63; 'our': 0.64; 'here': 0.66; 'approaches': 0.68; 'frank': 0.68; 'stated': 0.69; 'press': 0.70; 'internet': 0.71; 'future,': 0.83; 'different.': 0.84; 'explorer': 0.84; 'url:tinypic': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From "Frank Millman" <frank@chagford.com>
Subject Re: Python declarative
Date Sat, 25 Jan 2014 09:18:44 +0200
References <mailman.5529.1389805825.18130.python-list@python.org> <8fde6d34-47c5-49a1-a6d0-9ffe3df2d401@googlegroups.com> <CAPTjJmokZUHta7Y3x_=6eUjKpv2Td2iaqro1su7NuLo+gfzwag@mail.gmail.com> <lbtb9r$ljd$1@ger.gmane.org> <CAPTjJmo+EuY439wB0C8or+ZAcYeNR844HAKwL3i2+55dDE8LNA@mail.gmail.com> <lbtnft$6gf$1@ger.gmane.org> <CAPTjJmpi-kvJAVs2gK+nH5n6q3REkJaKR=CZeRfzUgDk8_VLGw@mail.gmail.com>
X-Gmane-NNTP-Posting-Host 197.87.184.151
X-MSMail-Priority Normal
X-Newsreader Microsoft Outlook Express 6.00.3790.4657
X-RFC2646 Format=Flowed; Original
X-MimeOLE Produced By Microsoft MimeOLE V6.00.3790.4913
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5968.1390634333.18130.python-list@python.org> (permalink)
Lines 126
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1390634333 news.xs4all.nl 2945 [2001:888:2000:d::a6]:57352
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:64728

Show key headers only | View raw


"Chris Angelico" <rosuav@gmail.com> wrote in message 
news:CAPTjJmpi-kvJAVs2gK+nH5n6q3REkJaKR=CZeRfzUgDk8_VLGw@mail.gmail.com...
> On Fri, Jan 24, 2014 at 11:49 PM, Frank Millman <frank@chagford.com> 
> wrote:
>>
>

[...]

I have realised that we unlikely to come to an agreement on this in the near 
future, as our philosophies are completely different.

You have stated that your objective is to express as much as possible in 
Python code.

I have stated that my objective is to express as little as possible in 
Python code.

We would have to resolve that difference of opinion first, before discussing 
our respective approaches in detail, and that is way beyond the scope of 
this thread.

As a brief example of my approach, here is how I would write your simple 
'About' box.

Here is your version -

mainwindow = GTK2.Window(0)->add(GTK2.Vbox(0,0)
    ->add(GTK2.Label("About Gypsum: big long multi-line string"))
    ->add(GTK2.HbuttonBox()
        ->add(GTK2.Button("Close"))
        ->add(GTK2.Button("Foobar"))
    )
);

Here is my version -

<form name="ChrisAbout_form">
  <data_objects/>
  <input_params/>
  <output_params/>
  <rules/>
  <frame>
    <body>
      <block/>  <!-- an html div -->
      <panel/>  <!-- an html table -->
      <row/>
      <col/>
      <text value="This is line one of a multi-line string"/>
      <row/>
      <col/>
      <text value="This is line two of a multi-line string"/>
      <row/>
      <col/>
      <text value="This is line three of a multi-line string"/>
    </body>
    <button_row>  <!-- an html div -->
      <button btn_id="btn_close" btn_label="Close" len="60"
          btn_enabled="true" btn_validate="false" btn_default="true">
        <end_form state="completed"/>
      </button>
      <button btn_id="btn_foo" btn_label="Foobar" len="60"
          btn_enabled="true" btn_validate="false" btn_default="false">
        <pyfunc name="path1.path2.foobar"/>
      </button>
    </button_row>
    <frame_methods>
      <method name="on_req_close">  <!-- user clicked [X] or pressed 
Shift_F4 -->
        <end_form state="completed"/>
      </method>
      <method name="on_req_cancel">  <!-- user pressed Escape -->
        <end_form state="completed"/>
      </method>
    </frame_methods>
  </frame>
</form>

Currently I do not have a widget for a multi-line label, so I just show 
three separate lines. If I ever needed one, it would not take long to 
create.

I took two screenshots, but I don't know the best way to upload and share 
them. I found a site called tinypic, which works, but the screen is 
cluttered with a lot of other stuff. Still, it shows what I want.

First, here is the screen as rendered in Internet Explorer (it works in 
other browsers as well - even on my smart phone, though I have not done any 
optimising for mobile devices yet) -

http://tinypic.com/r/ip15xx/5



Second, here is the screen designer, showing a portion of the screen 
definition - one of the buttons. As you can see, the designer does not have 
to worry about XML at all -


http://tinypic.com/r/1j7sdh/5



I am not claiming that I am 'right', or that this is a perfect solution. It 
is just 'where I am' right now, after quite a long period of evolution, and 
it is achieving a large portion of what I am aiming for, so I will press on 
with my current approach for now.



Hopefully it will not take *too* long before I am in a position to release 
something, and then I will be very interested in any feedback.



Thanks for the interesting discussion.



Frank




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


Thread

Python declarative Sergio Tortosa Benedito <sertorbe@gmail.com> - 2014-01-15 18:02 +0100
  Re: Python declarative Francesco Bochicchio <bieffe62@gmail.com> - 2014-01-17 06:22 -0800
    Re: Python declarative Francesco Bochicchio <bieffe62@gmail.com> - 2014-01-19 23:25 -0800
  Re: Python declarative sertorbe@gmail.com - 2014-01-17 06:47 -0800
    Re: Python declarative Tim Roberts <timr@probo.com> - 2014-01-18 13:13 -0800
  Re: Python declarative sertorbe@gmail.com - 2014-01-19 02:27 -0800
  Re: Python declarative sertorbe@gmail.com - 2014-01-22 12:38 -0800
  Re: Python declarative Asaf Las <roegltd@gmail.com> - 2014-01-22 13:16 -0800
    Re: Python declarative Chris Angelico <rosuav@gmail.com> - 2014-01-23 13:29 +1100
    Re: Python declarative Terry Reedy <tjreedy@udel.edu> - 2014-01-22 23:08 -0500
    Re: Python declarative "Frank Millman" <frank@chagford.com> - 2014-01-24 11:21 +0200
      Re: Python declarative Rustom Mody <rustompmody@gmail.com> - 2014-01-24 01:53 -0800
        Re: Python declarative "Frank Millman" <frank@chagford.com> - 2014-01-24 15:06 +0200
    Re: Python declarative Chris Angelico <rosuav@gmail.com> - 2014-01-24 22:18 +1100
    Re: Python declarative "Frank Millman" <frank@chagford.com> - 2014-01-24 14:49 +0200
    Re: Python declarative Burak Arslan <burak.arslan@arskom.com.tr> - 2014-01-24 15:40 +0200
    Re: Python declarative Chris Angelico <rosuav@gmail.com> - 2014-01-25 00:55 +1100
    Re: Python declarative Matěj Cepl <mcepl@redhat.com> - 2014-01-24 17:28 +0100
    Re: Python declarative Chris Angelico <rosuav@gmail.com> - 2014-01-25 03:33 +1100
      Re: Python declarative sertorbe@gmail.com - 2014-01-24 10:51 -0800
    Re: Python declarative "Frank Millman" <frank@chagford.com> - 2014-01-25 09:18 +0200
      Re: Python declarative Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-01-26 02:33 +0000
        Re: Python declarative Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-26 02:45 +0000
          Re: Python declarative Asaf Las <roegltd@gmail.com> - 2014-02-02 18:17 -0800
        Re: Python declarative Chris Angelico <rosuav@gmail.com> - 2014-01-26 14:38 +1100
        Re: Python declarative Chris Angelico <rosuav@gmail.com> - 2014-01-26 15:06 +1100
          Re: Python declarative Rustom Mody <rustompmody@gmail.com> - 2014-01-25 20:47 -0800
            Re: Python declarative Chris Angelico <rosuav@gmail.com> - 2014-01-26 16:23 +1100
              Re: Python declarative Rustom Mody <rustompmody@gmail.com> - 2014-01-26 00:05 -0800
                Re: Python declarative "Frank Millman" <frank@chagford.com> - 2014-01-26 11:12 +0200
                Re: Python declarative Rustom Mody <rustompmody@gmail.com> - 2014-01-26 06:36 -0800
          Re: Python declarative Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-01-26 12:05 +0000
        Re: Python declarative "Frank Millman" <frank@chagford.com> - 2014-01-26 08:03 +0200
          Re: Python declarative Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-01-26 12:21 +0000
    Re: Python declarative Chris Angelico <rosuav@gmail.com> - 2014-01-25 18:33 +1100
    Re: Python declarative matej@ceplovi.cz (Matěj Cepl) - 2014-01-25 12:23 +0100
  Re: Python declarative Asaf Las <roegltd@gmail.com> - 2014-01-24 04:04 -0800

csiph-web