Questions related to windows

Setting up the height of a window + What does pw stand for?

Didier Saturday (February 5th 2011) This is a pretty dumb question. I have in my code the following width: .pw.add.pw.left -width 310

What do I have to do to set the height? This? .pw.add.pw.left -height 110. I tried and it does not work. Any idea what should be typed in?

I have another question: I see pw.forget in the code. What does this forget do? What does it forget? :-) Thanks!

RLE (2011-02-05): Without knowing what kind of widget that path (.pw.add.pw.left) refers to, it is impossible to answer your question.

As to pw.forget, as we are not psychic, we can't tell. "pw.forget" is not a built-in Tcl or Tk command, so it must refer to a proc that the code you are looking at has defined. So you will have to find the definition of pw.forget to find out what it does. Unless you meant ".pw.forget" (widget path), in which case, the answer is almost the same, look in the code for where "pw.forget" or ".pw.forget" is defined, and read what it does there.

Didier (2011-02-06) Thanks for the info! I won't forget to look up the code for forget :-)

Problem solved. Tx!


Opening a window that duplicates the program we're on

Steven, November 3rd Opening a window that duplicates the program we're on


Problem with pop-up windows using Tk and Linux

LES 2009-08-20: I've had this problem with Tk and Linux for a long time:

I have a few Tk applications I made myself and some of them may create a new, separate window at certain times. For the sake of this explanation, let's assume it's the ordinary pop-up Tk error dialog.

Whenever I am using a non-Tk application A and it causes a new window B to pop up, the following sequence of events occurs:

  • The pop-up window (B) has focus immediately. That is always reflected on the title bar: it is displayed in its pre-configured black color, not light gray, because light gray is the color applied by my window manager to windows that do not have focus.
  • The pop-up window (B) entry has bold typeface on my taskbar (KDE).
  • I close the pop-up window (B) and the application I was using before (A) has focus immediately. That is reflected on the title bar: it is displayed in its pre-configured black color, not light gray. The application (A) also acquires the expected bold typeface on my task bar.
  • I can easily Alt+Tab to any other window if I want.

Whenever I am using a Tk-based application A and it generates a pop-up window (B), the following sequence of events occurs:

  • The pop-up window (B) has focus immediately. That is always reflected on the title bar: it is displayed in its pre-configured black color, not light gray, because light gray is the color applied by my window manager to windows that do not have focus.
  • The pop-up window (B) entry has bold typeface on my taskbar (KDE).
  • I close the pop-up window (B) and here comes the problem: the application I was using before (A) has focus immediately, I can type into it, but its title bar becomes light gray, the color that my window manager applies to windows that do not have focus. And it does not recover the bold typeface on the task bar. Instead, the title bar entry keeps flashing for a few seconds then it stops flashing and remains highlighted in blue, unlike all the other entries in the taskbar.
  • If I Alt+Tab just once, I do not switch to another window. Instead, part of the Tk application window (a text widget) flashes gently, but nothing else changes in the window state. It still has a light gray title bar and a highlighted taskbar entry.
  • If I Alt+Tab twice, I switch to another window (if there is any other window open). The Tk-based application window will not look and behave "normal" again until I Alt+Tab back to it from another window.

That is very, very annoying because I Alt+Tab all the time, and whenever my Tk app acts up in that way, I have one or two windows that won't Alt+Tab unless I Alt+Tab twice. How do I get rid of that problem?

Duoas IIRC, This is a window manager problem, and not a Tk problem per se. I always explicitly focus my window after a dialogue just to get past stupid wms. (Even KDE, which I tend to like best, BTW, has some stupidosity in it.) Sorry if this isn't much help.