osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ttk.Notebook Tabs Question


On Fri, 15 Sep 2017 20:45:20 +0100, MRAB wrote:

> On 2017-09-15 16:24, Wildman via Python-list wrote:
>> On Fri, 15 Sep 2017 06:09:21 +0400, Abdur-Rahmaan Janhangeer wrote:
>> 
>>> try
>>> widget["width"] it returns string
>>> then mult by no. of tabs
>> 
>> Since the tabs are displaying text, I believe the width
>> would be returned as characters or letters like a Button
>> or Text widget.  I need pixels.
>> 
> Why assume that the width is returned as characters? Why not try it?

If I set the width of the tabs, the width is in characters
so I expected it to be the same.

style = ttk.Style()
style.theme_create( "MyStyle", parent="alt", settings={
    "TNotebook": {"configure": {"tabmargins": [2, 5, 2, 0] } },
    "TNotebook.Tab": {"configure": {"padding": [0,0], "width": [7]}, }})
style.theme_use("MyStyle")

Also, I tried "widget["width"] and it returns 0.  Same
for height.

-- 
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!