1

What is the difference between the

winfo height *window*
winfo width *window*

commands and the

winfo screenheight *window*
winfo screenwidth *window*

commands?

Having read the documentation here: Tk Built-In Commands , it seems to me like there is no difference in their return values. If so, what is the reason for the existence of these seemingly identical commands, historically?

Vee
  • 729
  • 10
  • 27
  • 1
    The window and the window's **screen** are not the same thing. Have you tried running them on a window of yours to see what they return? – Etan Reisner Jul 24 '14 at 15:05
  • Ah I tested it now, thanks. Sorry for posting such a question so quickly before testing!! – Vee Jul 24 '14 at 15:09
  • The other one to beware of is `winfo reqheight`, which is the _requested_ height; `winfo height` is the _observed_ height. These can differ (and if that's causing problems, consider scheduling the code in a `` event…) – Donal Fellows Jul 25 '14 at 23:23

1 Answers1

2

This is easy to test:

strobel@suse131-intel:~> wish
% winfo height .
200
% winfo screenheight .       
1200

So one is window, one is screen.

P.S. you should not answer in a comment, the question can't be marked answered.

Str.
  • 1,389
  • 9
  • 14