GUIs - A Modest Proposal

S

Stephen Hansen

From a functionality perspective, "pack" and "grid" are both distinctly
less capable then wx sizers.

Are you just flapping your gums or can you prove it Stephen? I will
accept any "Pepsi Challenge" you can muster in Wx code and echo that
same capability using Tkinter[1] in what will be no less than elegant
simplicity. So bring it on baby!

But, as to capabilities-- the ones I use not infrequently:

- Shaped expansion: the control maintains its aspect ratio.
- Fitting: The parent widget is resized so that it is the right size
to contain all of its children widgets at their 'best' size (which is
configured per-widget, and not per-column; min sizes on a column is
insufficient). I absolutely adore this feature.
- Alignment. If a widget is allocated 100x100 of space (due to
proportion rules), but not set to expand, control over if it should
center directly, or be aligned top-center or left-middle.
- Spacers. As in a virtual 'widget' which takes up space but doesn't
really exist. Yeah, you can just put some empty looking widget in there,
but that's a hack. Still, this is only a nitpick.

I'm not interested in dueling code, but capabilities.

--

Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT) io
... Blog: http://meh.ixokai.io/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)

iQEcBAEBAgAGBQJMFuv8AAoJEKcbwptVWx/lLXAH/R5IjOmEuCabnlhhuEilQZrF
I61ozQroyHySFBqkoPuubZhTmqVzN4NPk6kSZ4YsdnwwwM/usNLDPDkiymYusQFw
Lt2C67GP0o6P1JA2B91xd7Yt4V7SsWIUAjRVi6haYYeb8o22zqMC/a2UN9V99NHU
dDdpKrd4x5R2B6C4896elFOTR5UG+fDQrf0SPhA1aK7OVa/pU4MK0U7wIoLhUhbj
+16W/rGC+cltG5/OatNUmq15vTtRYKYH3VwuMCWXHMozrzL8vXMYZGgiGZ5q09FL
p8zI5pTc8gGYH7JZmNf6F7oL9z+hPcZf+UX3euhEseXg4SEcZerxvzO8oFhsxh0=
=VFO/
-----END PGP SIGNATURE-----
 
A

AD.

Very nice. And interesting. "position: absolute" there is a mystery to
me and seems to be key, I'm not sure entirely what it is doing to the
layout manager in that scenario, but it seems to do the trick.

The Cliff Notes:

position: absolute allows different combos/subsets of
left,right,top,bottom,width,height to define where each edge is in
relation to the edges of its closest parent that has also been
positioned that way or the browser window if there is none. But it
does take that element out of the normal flow (like a float does),
which means all the statically positioned stuff won't interact with it
at all - that can be enough to negate the usefulness of it all.

position: relative is similar, but the edge offsets apply to where the
element would normally have sat rather than the edges of an explicitly
positioned parent element.
Much, much, much Googling led me to try many things to get it just
right, and all bemoaned the lack of a solid way to vertically center:
all the while using essentially similar methods to horizontally center.

I'd recommend the book "Pro CSS and HTML Design Patterns" from Apress
for anyone who wants to get a more formal understanding of these
different models etc.
 
L

lkcl

 so they _had_ to put the glib/gobject bindings in, after all that
effort spent fighting tooth and nail to prevent it... and not having
access to the key developer who worked on it (because of censorship)
it's been a bit of a bitch for them, and it's only about 80% complete,
after 6 months (the initial work only took 10 weeks!)

important afterthought: xan, who was responsible for working on the
webkit glib/gobject bindings after the webkit censorship engineered
and enacted by mark rowe, has been absolutely fantastic, along with
the people who worked with him to review the patches.

l.
 
R

rantingrick

I wasn't aware of [row|column]configure, no: however, I am dubious of
how it directly applies.

Maybe you should become more aware of a subject before you start
running your mouth about it, eh?
Consider this relatively simple user interface layout:http://ixokai.io/get/layout-grid.jpg

In this context, we have two principle columns, A and B. A has a set
size, B grows to fill the rest of the dialog.

Inside of A, there are four items in a vertical line. The bottom which
takes up half of the total vertical space (poorly drawn, trust me, F
should be half :)), and the top three share the rest.

Inside of B, G is one third the size of H.

The layout should fully resize itself as the window is resized.

How would you implement that in tkinter? It sounds like you'd have a
grid with a pair of one-column grids, which is slightly bizarre seeming.

Please at least try to make it a bit harder next time, really!

import Tkinter as tk
app = tk.Tk()
app.columnconfigure(1, weight=1)
app.rowconfigure(3, weight=1)
tk.Button(app, text='C', width=20).grid(row=0, column=0,
sticky='nswe')
tk.Button(app, text='D', width=20).grid(row=1, column=0,
sticky='nswe')
tk.Button(app, text='E', width=20).grid(row=2, column=0,
sticky='nswe')
tk.Button(app, text='F', width=20).grid(row=3, column=0, rowspan=2,
sticky='nswe')
tk.Button(app, text='G').grid(row=0, column=1, rowspan=2,
sticky='nswe')
tk.Button(app, text='H').grid(row=2, column=1, rowspan=2,
sticky='nswe')
app.mainloop()

....but i won't hold my breath awaiting for your "spectacular" Wx code
because i know it was just vaporware from gum_flap[0] on.
 
S

Stephen Hansen

I'd recommend the book "Pro CSS and HTML Design Patterns" from Apress
for anyone who wants to get a more formal understanding of these
different models etc.

Favorite'd on Safari, thanks for the tip.

--

Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT) io
... Blog: http://meh.ixokai.io/

P.S. Once upon a time, I'd have Amazon'd the book and skimmed it and
then lost it, and bought it again. I love Safari.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)

iQEcBAEBAgAGBQJMFvakAAoJEKcbwptVWx/lFLIH/14/yaFJZGTHE+B+dxb280AG
UHIYPg+IAePJ2b+EboYW54RKfYKVjKcXo1eUAibl9gEcXKMccRdMlwWJRUj8qLco
+DfP/Sk+ln8CEK7d8MKaUoWJnng+3w6roURaiMhf+l2iswtZnuBvMVQrhvLldGo4
j5Cadf6iKp1irPNJPO1IFv0CrXHmR90/YkIn20QPaOt27wnl9alQVs55emaCPyM2
LS6LyDER5agHj+P/Dl5cKVxObxkuJaEhAkgsPNWjGKv2aXW5UoVcee/8Oblgu4UM
AAQYR+kgezDKzXz61AfUp6FYkZxnHjUgEF95BMoqK+gqBDNV14579POeCqsUab0=
=x+Uv
-----END PGP SIGNATURE-----
 
S

Stephen Hansen

I wasn't aware of [row|column]configure, no: however, I am dubious of
how it directly applies.

Maybe you should become more aware of a subject before you start
running your mouth about it, eh?

You know what?

You're an asshole.

Just saying.

I've been trying very hard not to say, "Go screw yourself, jackass" for
a few days now. Very hard. I've tried very hard to remain civil.

But really, I just feel a need to say it.

You're a complete and utter jackass.

Just saying.
Please at least try to make it a bit harder next time, really!

import Tkinter as tk
app = tk.Tk()
app.columnconfigure(1, weight=1)
app.rowconfigure(3, weight=1)
tk.Button(app, text='C', width=20).grid(row=0, column=0,
sticky='nswe')
tk.Button(app, text='D', width=20).grid(row=1, column=0,
sticky='nswe')
tk.Button(app, text='E', width=20).grid(row=2, column=0,
sticky='nswe')
tk.Button(app, text='F', width=20).grid(row=3, column=0, rowspan=2,
sticky='nswe')
tk.Button(app, text='G').grid(row=0, column=1, rowspan=2,
sticky='nswe')
tk.Button(app, text='H').grid(row=2, column=1, rowspan=2,
sticky='nswe')
app.mainloop()

Does not perform to spec. Quote, "Inside of A, there are four items in a
vertical line. The bottom which takes up half of the total vertical
space, and the top three share the rest.

Notice in: http://ixokai.io/get/layout-results-tk.jpg

That C, D, and E do not expand as they do, but instead F takes it all,
when it is supposed ot be entitled to only half of the vertical space.

Compare: http://ixokai.io/get/layout-results-wx1.jpg
And: http://ixokai.io/get/layout-results-wx2.jpg

I took some extra care to colorize the panels so its easy to see the
layout characteristics.

The code is at: http://ixokai.io/get/layout-wx.py_

Yes, its more verbose. And object oriented. This is a positive. I could
have made it all a great deal shorter and more concise, but left it
verbose for clarity's sake.
...but i won't hold my breath awaiting for your "spectacular" Wx code
because i know it was just vaporware from gum_flap[0] on.

Go screw yourself.

--

Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT) io
... Blog: http://meh.ixokai.io/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)

iQEcBAEBAgAGBQJMFvzKAAoJEKcbwptVWx/lmn0IAJqmi+SOcpuaEjQ5w/PSuE7Z
eQqeVgN4Jfp1JJnYPo4RxBVREvZsmGwrU+xIFyso0p4EQVh8VQfH+5xY8vpZRsAv
D9HTlQK03ei4CR/T35k3cfRjeK09kJ4ZI3TSGDJKOZsaKoTqSpQ8KaR/6xkOScTC
3/T90T6b6JoDgf605HQJDn9g2/cfysbabTQC7rt/CeSvy1LWIwu69lGJQ0kKMkQN
SxFsYlIcCqUcqdJ6lTWkDks9cZ2OZ+cRuqJ4jZjIqtCHiyjDsZPCT48c/Ewtyrao
oLE8m+3KEBQj4RH2jjkKNaQePVBVrXvqxOSKTfVQVvXm+J4jnJIfztnN0/vvlFo=
=FVoK
-----END PGP SIGNATURE-----
 
S

Stephen Hansen


If you've already downloaded this, you have to do so again; I uploaded
the wrong one on accident.

--

Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT) io
... Blog: http://meh.ixokai.io/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)

iQEcBAEBAgAGBQJMFv/LAAoJEKcbwptVWx/lqxcH/jsc6WbdK0XXtDX/ccpOpArA
bVA2tcHob+4e6ZySaIcssF06C7GoBJuW+M6uKPhp2lAKsY7j3AbJjAfrzxCgTN8P
xrMJzReLXpcu/ioNhrWV6/S7zEv+ewoK9NX1gS5kBDxnsrrr2KnbVj1HiHrESw9F
if9WB3CQZq4T57JZVjlH4pz4HdhQV+ifYozU3PmVqs1K8n2Q6WEDTcOpjTSv+rqZ
XV5tgmoq/U8Zva4iU1xyCVMuBXHc4zCvh9eyxACgohhKx5O/mdLzmi+7zQhxjQsc
ytsHH/G2qoZIaq9EJZ8WevCgnhgCPl0SwoVmvw3m/Ln4kjiqAqAjMJ3GI3bDJEI=
=3/hr
-----END PGP SIGNATURE-----
 
R

rantingrick

You know what? <SNIP EXPLETIVES>

You know what Stephen, just calm down a little. I just pick on you
because you're one of the few people here that i enjoy arguing with.
Anyhoo i ran your code and got this traceback...

Traceback (most recent call last):
File "C:/Python26/tempGridWx.py", line 64, in <module>
main()
File "C:/Python26/tempGridWx.py", line 60, in main
app = TestApp(0)
File "C:\Python26\lib\site-packages\wx-2.8-msw-ansi\wx\_core.py",
line 7978, in __init__
self._BootstrapApp()
File "C:\Python26\lib\site-packages\wx-2.8-msw-ansi\wx\_core.py",
line 7552, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "C:/Python26/tempGridWx.py", line 52, in OnInit
frame = TestFrame(None)
File "C:/Python26/tempGridWx.py", line 8, in __init__
panel_c = wx.Panel(self, -1, width=(100, -1))
File "C:\Python26\lib\site-packages\wx-2.8-msw-ansi\wx\_windows.py",
line 68, in __init__
_windows_.Panel_swiginit(self,_windows_.new_Panel(*args,
**kwargs))
TypeError: 'width' is an invalid keyword argument for this function

.... i was hoping you would post some code that did not blow chunks and
since your explanations are a bit hard to follow i will await the bug-
free Wx code so nothing else is again lost in translation. When the
bug free code is supplied i will create the Tkinter mirror of it.
 
S

Stephen Hansen

You know what Stephen, just calm down a little. I just pick on you
because you're one of the few people here that i enjoy arguing with.
Anyhoo i ran your code and got this traceback...

Argue.

Don't be an asshole.

There's a difference.
... i was hoping you would post some code that did not blow chunks and
since your explanations are a bit hard to follow i will await the bug-
free Wx code so nothing else is again lost in translation. When the
bug free code is supplied i will create the Tkinter mirror of it.

I already uploaded the replacement. I pasted from my mac box instead of
my windows one where I tested it out ('cuz my mac Python installation is
keyed to work and doesn't like wx) on accident.


--

Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT) io
... Blog: http://meh.ixokai.io/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)

iQEcBAEBAgAGBQJMFwOHAAoJEKcbwptVWx/lDZMH/2AxU5ypmg6H5NNv39l0rfYo
4EOS+FsNRJTG7ERTeUG1GI+FigflauuHH2iG/SIiLtS4FIWBKSIgsxN52qCfmD8Y
XnGPIm2AxicxGpo6YC03izfy0GpJp2gDy04NeBKthCj2J9VCJNVw2WpT2ILQL1Si
wzrONzSN7S9uAD9TYI/89hmNiqwS7IShbjWVNdrHNRWKVJvJ7xo5U+ujRhm2zgc2
n631QAI5XHrkPU8Cbvx37WZUIMi3JkU3d8PnBqOkCn/+6k3ooRQvrwmf0PAr0flG
Mocr1n09Q7FolxMi83JvF+KfRQkowVTKqSXmpg0pZDFfcju4bDBuRhnVsoVyliQ=
=OhXi
-----END PGP SIGNATURE-----
 
R

rantingrick

Does not perform to spec. Quote, "Inside of A, there are four items in a
vertical line. The bottom which takes up half of the total vertical
space, and the top three share the rest.

No problem, check this out...

import Tkinter as tk
app = tk.Tk()
app.geometry('400x400+20+20')
# Left
tk.Label(app, text='C', bg='red', width=20).place(rely=0.0,
relheight=0.1667, width=200)
tk.Label(app, text='D', bg='blue', width=20).place(rely=0.1667,
relheight=0.1667, width=200)
tk.Label(app, text='E', bg='green', width=20).place(rely=0.3333,
relheight=0.1667, width=200)
tk.Label(app, text='F', bg='white', width=20).place(rely=0.5,
relheight=0.5, width=200)
# Right
tk.Label(app, text='G', bg='purple').place(x=200, rely=0.0,
relheight=0.333, relwidth=1)
tk.Label(app, text='H', bg='orange').place(x=200, rely=0.3333,
relheight=0.777, relwidth=1)
app.mainloop()


However *your* code does not perform to your own spec! You said
this...
Inside of B, G is one third the size of H.

If you mean that G should be one-third the "height" of H then your
code (and yes i have the new version that does not blow chunks!) does
not follow this spec! Better re-check my friend. ;-)
 
S

Stephen Hansen

No problem, check this out...

import Tkinter as tk
app = tk.Tk()
app.geometry('400x400+20+20')
# Left
tk.Label(app, text='C', bg='red', width=20).place(rely=0.0,
relheight=0.1667, width=200)
tk.Label(app, text='D', bg='blue', width=20).place(rely=0.1667,
relheight=0.1667, width=200)
tk.Label(app, text='E', bg='green', width=20).place(rely=0.3333,
relheight=0.1667, width=200)
tk.Label(app, text='F', bg='white', width=20).place(rely=0.5,
relheight=0.5, width=200)
# Right
tk.Label(app, text='G', bg='purple').place(x=200, rely=0.0,
relheight=0.333, relwidth=1)
tk.Label(app, text='H', bg='orange').place(x=200, rely=0.3333,
relheight=0.777, relwidth=1)
app.mainloop()

Very good. However, you're now doing a lot of complicated manual
placements and numbers. Just noting this for the record.
However *your* code does not perform to your own spec! You said
this...

If you mean that G should be one-third the "height" of H then your
code (and yes i have the new version that does not blow chunks!) does
not follow this spec! Better re-check my friend. ;-)

No, my code goes to spec-- though I concede the point that the spec may
not have been stated clearly.

Your code has the total height of B(the entire right column) being X;
and G is one third of that total height, while H is 2/3'ds of it. That's
close, but very specifically not what I was going for.

I was going for B having a total height of "X"; and that H is 300% the
size of G, as demonstrated in the following:

http://ixokai.io/get/layout-results-comparison.jpg

You should be able to see that your "G" is half the size of "H", where
mine is one third of its size. If you dispute this assertion, I can
provide exact measurements to demonstrate, but it should be visually clear.

But, that said: You're very close, close enough to satisfy the
challenge. But that's an easy one.

I now present you the following alterations to the existing spec:

- A must be a set, fixed size of 100x20.
- H must expand fully, but maintain its aspect ratio.

Now, in addition, in my code I made it so I could add as many new items
to the top half of the left-column, and not require any tweaking of
other things. This way, it can elegantly be expanded. The "F" panel
which must be the bottom 50% doesn't ever need to be modified-- I simply
add more things to the top half and it adjusts accordingly.

A few tiny modifications to the existing code is at:

http://ixokai.io/get/layout-wx2.py_

And the image is:

http://ixokai.io/get/layout-results-wx4.jpg

--

Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT) io
... Blog: http://meh.ixokai.io/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)

iQEcBAEBAgAGBQJMFxg7AAoJEKcbwptVWx/lMBUH/RPGmD/lBfAgBp54oLU7Pb/S
o7pJjxKhbK0leCb6jEVoeQBr5dkxG0fm1p5Xlu/YocMrK+15er6zM4ZFnlj6lPbJ
1W/v/mvYfrxlCsbR9aygOPdO4DKxXQylahttimptau2anqkaRMh6Pyb1/++H+xn9
+cKJz3ePDL7j4WWIzDGjE8Nr2syxIESzNWoZog9kq1FHWQ6Kg1j3TmcnPo72LWsZ
irJ1xoxWZlnRy0984UugDJKgADGQdsI7rijVWkGJLLmCPmF7FHns6P795+WtJOeN
R7XQDI+jDYE9R5C8OBmBIoC/gGw/eciJh/ZyTjB2+iXZA5mtIWTsWQFVgpJ8yJg=
=1/I2
-----END PGP SIGNATURE-----
 
S

Stephen Hansen

I wasn't aware of [row|column]configure, no: however, I am dubious of
how it directly applies.

Maybe you should become more aware of a subject before you start
running your mouth about it, eh?

You know what?

You're an *beep*.

For the record, this was inappropriate. A moment's frustration after a
long day does not excuse belligerence, even if unnecessarily provoked.

I apologize.

--

Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT) io
... Blog: http://meh.ixokai.io/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)

iQEcBAEBAgAGBQJMFyCJAAoJEKcbwptVWx/lU7IIAK1nO3WuM097XN0M5QYbPFs4
BsJcTbJkVLwqtXgjYxo1qKiLvk5dHuCpatOaxu+OUGDi/4oW67QhCSN6RR4f+zI1
4gGuch4aDqgI0+nfiau8xcTgHNby1sS5myS+2NHIbjwxKyQICHoilN7uGPU3sI4B
3PWTW8DyQcgsyu3BjTwU5D2xBcCAyOiGoNAs1yGEWjlcwJh2c+9uZBK+DFvPxNcH
QYg3VAfgTZNTPYhHoYby6eHLBcQmVWp5QZE3EFZaIOfVzxjkQsKcj/jW95mdor13
7kD2Govvc2vjohtOCXzM1xsUZcvLgiKFopbHYd2gYjO1mst17Bb3eB+8VLGU5R0=
=eBb5
-----END PGP SIGNATURE-----
 
R

rantingrick

For the record, this was inappropriate. A moment's frustration after a
long day does not excuse belligerence, even if unnecessarily provoked.

I apologize.

No problem Stephen, as you'll find out over time i have a skin much
thicker than your average grape, unlike some folks round here.

Unfortunately though the code showdown will need to be postponed until
tomorrow. However my good friend Mark will be glad to know I just
grabbed my comfort blanket and teddy, had a lovely glass of warm milk
and some biscuits, and now mummy is tucking me up safely in bed. Kiss
mummy goodnight Mark... :-<>

;-)
 
A

Albert van der Horst

ant said:
My concern is simple: I think that Python is doomed to remain a minor
language unless we crack this problem.

Capitalist fallacy: If I'm not a market leader, I'm a failure
and my Mother will laugh at me.

Groetjes Albert
 
M

Mark Lawrence

No problem Stephen, as you'll find out over time i have a skin much
thicker than your average grape, unlike some folks round here.

Unfortunately though the code showdown will need to be postponed until
tomorrow. However my good friend Mark will be glad to know I just
grabbed my comfort blanket and teddy, had a lovely glass of warm milk
and some biscuits, and now mummy is tucking me up safely in bed. Kiss
mummy goodnight Mark... :-<>

;-)

With friends like you, who needs enemies?
 
G

Gregory Ewing

Stephen said:
unless I've been long mistaken in pack not
having a proportional option. A combination of "fill/expand" and
"anchor" do most of everything else, though, that wx's flags and
alignment options.

It's a while since I used tkinter, but if I recall correctly,
the grid manager does allow proportional resizing. And you
really don't need pack, you can use grid to do anything that
pack can do.

Having said that, experience has made me very skeptical
about the usefulness of proportional resizing. Most often,
there is one "main" content area in a window that
I want to give the user control over the size of, and the
other stuff around it can just as well be fixed size.

When that's not true, proportional sizing doesn't really
cut it -- you really need some kind of splitter control to
let the user adjust the allocation of space according to
the needs of the moment.
 
L

lkcl

 what we typically recommend is that _even_ though you're going to run
the application "desktop" - as pure python - you still use JSONRPC [or
XmlHTTPRequest if JSONRPC is overkill].  so, _even_ though it's a
desktop application, you still run a local 127.0.0.1 web service (even
python -m SimpleCGIServer.py will do the job!)
 rick's article is highly illustrative on all these points:
   http://www.ibm.com/developerworks/web/library/wa-aj-pyjamas/

Hmm. Depending on just how rich of a UI is possible, this is a slightly
compelling idea.

to be honest, if you don't put any effort in to use the appropriate
"lovely-prettiness" panels you can end up with something truly "90s-
esque". but with a little effort you can do round-edged lovely colour
tabs:
http://pyjs.org/examples/tabpanelwidget/output/Tabs.html
Right now, I have to essentially maintain two separate
code-bases: the desktop client and the web application.

deep joy!
In my scenario,
both are actually lightweight (though not truly thin) clients to a
master application server existing Elsewhere, that does the heavy
lifting and manages all its users.

Being able to take a code base and provide it to users as a
traditional-seeming desktop application that works desktopy for them,
with-- it sounds like-- two separate processes, one which is Python and
is "serving" data, and more importantly accessing the MCP and getting
instructions and doing its "lightweight" local lifting-- and another
which is just a UI that communicates to that local server?

basically, yes. splitting things more along the traditional MVC
lines. the M being the web server with JSONRPC to do traditional
Create-Update-Retrieve-Delete etc. and the VC bit being in pyjamas,
talking JSONRPC to the server *even* on the desktop version!
Then one would run basically the same code on a server to allow remote
access on some internet-accessible server, that sounds like what you're
implying is possible?

yes, even on the desktoppy version (because it's the same app)
This time the server is still there, but the
client UI is converted into pure JS and shipped to the persons machine.

yup.
That sounds too good to be true.

yup, it does. how can one person, a free software developer, have
come up with something like "The Holy Grail" of software development,
right? when all the money in the world, from ibm, adobe, microsoft,
google, nokia and so on _hasn't_ managed it, in what... 20 years of
computer science, right? i must be some sort of egomaniac, attention-
seeker, snake-oil-seller or just an outright liar, right? those _are_
supposed to be rhetorical questions :)
I sort of have to be reading too much
into what you're saying.

no, you got it. does what it says on the tin.

the "fly in the ointment" is that the success of pyjamas desktop is
critically dependent on its underlying DOM-bindings technology.
ironically, the non-free and proprietary dependence on MSHTML works
perfectly, whilst there are webkit developers *actively* destroying
the webkit-glib/gobject port, and the mozilla foundation developers
are trying desperately hard to break XPCOM (they've already side-lined
python-xpcom as "third party" now) because they're so "losing" so
badly to webkit that they are desperate to sacrifice everything to get
speed, speed, speed.

l.
 
S

Steven D'Aprano

to be honest, if you don't put any effort in to use the appropriate
"lovely-prettiness" panels you can end up with something truly "90s-
esque". but with a little effort you can do round-edged lovely colour
tabs:
http://pyjs.org/examples/tabpanelwidget/output/Tabs.html


All I get is a plain page with no content. No images, no text, nothing.
Shouldn't you at least include "This site requires Javascript to work"?

You know, I like the idea of pyjamas, but I am so utterly sick and tired
of javascript and flash running amok and web developers who try to take
over my browser that I've turned them off.
 
L

lkcl

All I get is a plain page with no content. No images, no text, nothing.
Shouldn't you at least include "This site requires Javascript to work"?

naaah. that would mean adding one extra line with a noscript tag to
the html loader page, increasing size of each of the example loader
pages by a whopping ten percent! :)
You know, I like the idea of pyjamas, but I am so utterly sick and tired
of javascript and flash running amok and web developers who try to take
over my browser that I've turned them off.

_hurrah_! i used to write web apps entirely server-side, no AJAX, no
JS, nothing, precisely to cater exactly for this feeling, which i
entirely agreed with. then i went absolute 100% the other way. i had
_nothing_ good to say about javascript, but by abstracting out to
python, i found the "wiggly path" that leverages its powerful bits
without falling into the trap of the god-awful mess that causes you to
rightly switch off JS entirely.

fortunately, for you, with pyjd you're in luck: python bindings to
DOM, doing exactly the same job as the equivalent JS - all JS gooone.

l.
 
L

lkcl

mind you, i am no python expert, but i really look forward to seeing
pyjamas in the stdlib :) anytime soon?

*choke* :)

... weelll... let me answer that as if it's serious. you'd have to:

a) define http://python.org as including a javascript target for its
output. given that pypy have (or had) this, that's not entiiirely
outside of the realms of possibility.

b) include ooo 10,000 lines of base UI widget libraries, which are
all written in pure python. again, not so bad.

c) completely rule out any possibility of pyjd because whilst the
win32 dependency is python-comtypes (which depends on ctypes which
whoops rules _that_ out) the free software dependencies are a choice
between pygtk2 plus xulrunner, libcairo, python-cairo, gobject plus
python-gobject and many more plus python-xpcom _plus_ python-hulahop,
or webkitgtk plus pywebkitgtk plus again many of the same pygtk
dependencies, each of which will come to around a whopping 30mb
download comprising some 90 to 100 separate libraries in each case...

and that's without dealing with the multitude of licenses.

... and without pyjd it's somewhat a pointless exercise.

overall i think this just reaffirms that the minimalist but
extensible python-tk approach really does have distinct advantages.
thus, at last, we come back full circle to the original question.
hooray!

l.
 

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,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top