[Tkinter-discuss] Fixed ratio split screen geometry manager

2018-03-06 Thread Nam Nguyen
Hi,

I'm looking for a fixed ratio 2-pane geometry manager.

I tried PanedWindow but it does not have any option for me to specify the
ratio of the children.

What I'm looking for is a geometry manager/container that splits its space
into two for the children. The children can grow only in their own spaces.
The children can come and go, but the parent container should maintain that
2-pane split with the same ratio.

Where should I look into?

Thanks!
Nam
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


Re: [Tkinter-discuss] configure command

2018-03-06 Thread Michael Lange
Hi,

On Tue, 6 Mar 2018 16:31:23 +
adil gourinda  wrote:

> In your example, is "width" a positional argument or a
> positional-keyword argument (and if it is what is the parameter's
> name) ?

Not sure what you mean by that; I would tend to say the parameter's name
is "width" ;)

At
https://www.tcl.tk/man/tcl8.4/TkCmd/panedwindow.htm#M33
this is explained in more detail.

Regards

Michael

.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Earth -- mother of the most beautiful women in the universe.
-- Apollo, "Who Mourns for Adonais?" stardate 3468.1
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


Re: [Tkinter-discuss] Fixed ratio split screen geometry manager

2018-03-06 Thread Michael Lange
Hi,

On Tue, 6 Mar 2018 09:57:01 -0800
Nam Nguyen  wrote:

> Hi,
> 
> I'm looking for a fixed ratio 2-pane geometry manager.
> 
> I tried PanedWindow but it does not have any option for me to specify
> the ratio of the children.
> 
> What I'm looking for is a geometry manager/container that splits its
> space into two for the children. The children can grow only in their
> own spaces. The children can come and go, but the parent container
> should maintain that 2-pane split with the same ratio.
> 
> Where should I look into?

in case you do not need the PanedWindow's resize handle, you might
want to have a look at the Grid geometry manager's uniform and weight
options to the grid_columnconfigure() and grid_rowconfigure() commands.

Another option might be to have a look at the Place geometry manager,
especially the relheight and relwidth options. Using for example 
relheight=0.5 will make the widget always occupy 50% of the parent
widget's height.

Best regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

The sight of death frightens them [Earthers].
-- Kras the Klingon, "Friday's Child", stardate 3497.2
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


Re: [Tkinter-discuss] configure command

2018-03-06 Thread adil gourinda
In your example, is "width" a positional argument or a positional-keyword 
argument (and if it is what is the parameter's name) ?

Thanks

From: Tkinter-discuss 
 on behalf of 
Michael Lange 
Sent: Monday, March 5, 2018 10:41 PM
To: tkinter-discuss@python.org
Subject: Re: [Tkinter-discuss] configure command

Hi,

On Sun, 4 Mar 2018 23:26:56 +
adil gourinda  wrote:

> [cid:132f79be-dacf-4e7a-b0b1-94f5411d267b]
> By this picture I tried to explain the translation of "configure"
> command from Tcl to Python configure() method.
>
> For the (1) and (3) cases the python's syntax is clear.
>
> But for the (2) case where in Tcl I need to write only the option's
> name without value, what is its equivalent in Python (when the
> parameter's name is an argument)?; I tried the syntax in the picture
> and it works but what make things more difficult is when there is
> another parameter before "option" (ex :PanedWindow.paneconfigure).
>
> Thanks for your attention

actually that is quite straightforward, as a little toying around reveals:

First a simple example in Tcl:

$ wish
% panedwindow .pw
.pw
% pack .pw
% text .pw.t
.pw.t
% .pw add .pw.t
% .pw paneconfigure .pw.t -width
-width {} {} {} {}
%

Now the same in Python:

$ python
Python 2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Tkinter import *
>>> root = Tk()
>>> pw = PanedWindow(root)
>>> pw.pack()
>>> t = Text(pw)
>>> pw.add(t)
>>> pw.paneconfigure(t, 'width')
('width', '', '', '', '')
>>>

So you see, the paneconfigure command works exactly the same in Python as
it does in Tcl.

Regards

Michael

.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Dismissed.  That's a Star Fleet expression for, "Get out."
-- Capt. Kathryn Janeway, Star Trek: Voyager, "The Cloud"
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss