Re: Make sure the window title is visible in tkinter

2019-06-30 Thread Cousin Stanley
Cousin Stanley wrote  

>>  You might try setting a given window geometry
>>  to accomodate the long title  
>>
>>  win_w = 400 
>>  win_h = 300
>>
>>  ofs_h = 40
>>  ofs_v = 30
>>
>>  window.geometry( "%dx%d+%d+%d" % ( win_w , win_h , ofs_h , ofs_v ) )
>>
>>  
>>  Maybe add a bit of extra space for users 
>>  with different default font sizes 
>>
>>  Not a general solution 
>>  but perhaps workable 

moi wrote  

> No, huge mistake.

  It isn't clear to me how specifying a particular geometry
  for one's own self-coded tkinter gui prgrams with windows
  that are resize-able would be a mistake 

> Take for example the Windows installer.
>
> The window is so small, you can not even read the path 
> where Python will be installed.
>
> Bonus: the windows is not resizable and part of items 
> are not even visible.
>
> It would be to bad to not mimic this behavior.
>
> Just tested it 2 min ago on my Windows 7.1 with py3.7.3.

  I didn't suggest modifying 3rd party programs,
  but the suggestion I offered was meant to be applied
  to one's own code 

  I have used a given geometry for dozens of my own
  tkinter gui programs such that a modest window size
  which assures that all widgets are viewable 
  when first presented to the user 


-- 
Stanley C. Kitching
Human Being
Phoenix, Arizona

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Make sure the window title is visible in tkinter

2019-06-28 Thread CrazyVideoGamez
On Wednesday, June 26, 2019, at 7:44:15 AM UTC-4, Cecil Westerhof wrote:
> I need to write a desktop program. I choose to use tkinter. How can I
> make sure the window title is visible? For example when I have the
> following code:
> from tkinter  import Button, filedialog, Label, messagebox, Tk
> 
> 
> window = Tk()
> window.title('A long window title')
> Button (window, text = 'Short text').pack()
> window.mainloop()
> 
> I see only a part of the 'A', but I would like to see the complete:
> 'A long window title'
> 
> -- 
> Cecil Westerhof
> Senior Software Engineer
> LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Maybe you should try to maximize the window so you can see everything. It put 
in your code and I could see more of the title.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Make sure the window title is visible in tkinter

2019-06-28 Thread Cecil Westerhof
Cecil Westerhof  writes:

> Wildman  writes:
>
>> On Wed, 26 Jun 2019 13:25:15 +0200, Cecil Westerhof wrote:
>>
>>> I need to write a desktop program. I choose to use tkinter. How can I
>>> make sure the window title is visible? For example when I have the
>>> following code:
>>> from tkinter  import Button, filedialog, Label, messagebox, Tk
>>> 
>>> 
>>> window = Tk()
>>> window.title('A long window title')
>>> Button (window, text = 'Short text').pack()
>>> window.mainloop()
>>> 
>>> I see only a part of the 'A', but I would like to see the complete:
>>> 'A long window title'
>>
>> According to link below, it is not possible...
>> "Tkinter has no way of knowing how long the title is on the titlebar."
>>
>> https://stackoverflow.com/questions/35273690/tkinter-window-not-wide-enough-to-display-window-title
>
> OK, then I will have to live with it.

I just make sure something is in my window that has such a width that
the tittle will be displayed. ;-)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Make sure the window title is visible in tkinter

2019-06-26 Thread Wildman via Python-list
On Wed, 26 Jun 2019 15:05:15 +0200, Cecil Westerhof wrote:

>> OK, then I will have to live with it.

I did find some references to a method where you first disable
the Tkinter title bar using overrideredirect(True).  Then you
create a new title bar using a frame and canvas.  You can then
set the font/size for the canvas.

I think you could do it with a label but if you want an icon
and close (X) button, that could be a problem.  IFAIK you can
have only one image on a label.

-- 
 GNU/Linux user #557453
"I am Lrrr! Ruler of the planet Omicron Persei 8!
Can I crash on your couch?"
  -Lrrr
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Make sure the window title is visible in tkinter

2019-06-26 Thread Grant Edwards
On 2019-06-26, Cousin Stanley  wrote:

>   You might try setting a given window geometry
>   to accomodate the long title  
> [...]

>   window.geometry( "%dx%d+%d+%d" % ( win_w , win_h , ofs_h , ofs_v ) )

>   Maybe add a bit of extra space for users with different default
>   font sizes 

IIRC, there is a way to get tkInter to render a string in a particular
font so that you can then find out how wide the result is in pixels.
It's been a long time since I needed to do that, and it was a bit of a
hassle.  I'm not sure how you would make sure it's rendered in the
same font as the window title.

-- 
Grant Edwards   grant.b.edwardsYow! I'm a fuschia bowling
  at   ball somewhere in Brittany
  gmail.com

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Make sure the window title is visible in tkinter

2019-06-26 Thread Cousin Stanley
Cecil Westerhof wrote:

> I need to write a desktop program. I choose to use tkinter. 
> 
> How can I make sure the window title is visible? For example 
> when I have the following code :

> from tkinter  import Button, filedialog, Label, messagebox, Tk
> 
> 
> window = Tk()
> window.title('A long window title')
> Button (window, text = 'Short text').pack()
> window.mainloop()
> 
> I see only a part of the 'A', but I would like to see 
> the complete :
>
>   'A long window title'
> 

  You might try setting a given window geometry
  to accomodate the long title  

  win_w = 400 
  win_h = 300

  ofs_h = 40
  ofs_v = 30

  window.geometry( "%dx%d+%d+%d" % ( win_w , win_h , ofs_h , ofs_v ) )

  
  Maybe add a bit of extra space for users 
  with different default font sizes 

  Not a general solution 
  but perhaps workable 


-- 
Stanley C. Kitching
Human Being
Phoenix, Arizona

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Make sure the window title is visible in tkinter

2019-06-26 Thread Cecil Westerhof
Wildman  writes:

> On Wed, 26 Jun 2019 13:25:15 +0200, Cecil Westerhof wrote:
>
>> I need to write a desktop program. I choose to use tkinter. How can I
>> make sure the window title is visible? For example when I have the
>> following code:
>> from tkinter  import Button, filedialog, Label, messagebox, Tk
>> 
>> 
>> window = Tk()
>> window.title('A long window title')
>> Button (window, text = 'Short text').pack()
>> window.mainloop()
>> 
>> I see only a part of the 'A', but I would like to see the complete:
>> 'A long window title'
>
> According to link below, it is not possible...
> "Tkinter has no way of knowing how long the title is on the titlebar."
>
> https://stackoverflow.com/questions/35273690/tkinter-window-not-wide-enough-to-display-window-title

OK, then I will have to live with it.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Make sure the window title is visible in tkinter

2019-06-26 Thread Wildman via Python-list
On Wed, 26 Jun 2019 13:25:15 +0200, Cecil Westerhof wrote:

> I need to write a desktop program. I choose to use tkinter. How can I
> make sure the window title is visible? For example when I have the
> following code:
> from tkinter  import Button, filedialog, Label, messagebox, Tk
> 
> 
> window = Tk()
> window.title('A long window title')
> Button (window, text = 'Short text').pack()
> window.mainloop()
> 
> I see only a part of the 'A', but I would like to see the complete:
> 'A long window title'

According to link below, it is not possible...
"Tkinter has no way of knowing how long the title is on the titlebar."

https://stackoverflow.com/questions/35273690/tkinter-window-not-wide-enough-to-display-window-title

-- 
 GNU/Linux user #557453
"There are only 10 types of people in the world...
those who understand Binary and those who don't."
  -Spike
-- 
https://mail.python.org/mailman/listinfo/python-list