From: rantingrick on
On Jun 14, 11:08 pm, Stephen Hansen <me+list/pyt...(a)ixokai.io> wrote:

> > Maybe you should become more aware of a subject before you start
> > running your mouth about it, eh?
>
> 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.
From: rantingrick on
On Jun 14, 11:08 pm, Stephen Hansen <me+list/pyt...(a)ixokai.io> wrote:
<snip>

> 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. ;-)

From: Stephen Hansen on
On 6/14/10 10:35 PM, rantingrick wrote:
> On Jun 14, 11:08 pm, Stephen Hansen <me+list/pyt...(a)ixokai.io> wrote:
> <snip>
>
>> 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()

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...
>> 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. ;-)

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/

From: Stephen Hansen on
On 6/14/10 9:08 PM, Stephen Hansen wrote:
> On 6/14/10 8:31 PM, rantingrick wrote:
>> On Jun 14, 9:41 pm, Stephen Hansen <me+list/pyt...(a)ixokai.io> wrote:
>>
>>> 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/

From: rantingrick on
On Jun 15, 1:41 am, Stephen Hansen <me+list/pyt...(a)ixokai.io> wrote:
> On 6/14/10 9:08 PM, Stephen Hansen wrote:
> > 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.

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

;-)