I tried to open a new window at the same position as another window.
My Code:
window2.set_position(window1.get_position())
But it doesn't work.
Call GetConsoleWindow to get the console window handle. Then detach via FreeConsole . Then call MoveWindow or SetWindowPos to move and resize the console window.
Right-click the window tab and select Move>View (to move a separate window). Move the mouse to where you want the window to display and left-click to confirm the move. Right-click the window tab and select Move>Tab Group (to move several tabbed windows) from the list.
Initial Window Position To change this we can add the height and width position to the geometry method. When Tkinter positions a window it references the top left corner of the window. Here, we position the top left corner of the window right 300 pixels and down 300 pixels. Note the “+” symbol before each position.
set_position
just sets a general hint (e.g. center the window). You need the move
method:
window2.move(pos_x, pos_y)
see here: http://faq.pygtk.org/index.py?req=show&file=faq10.003.htp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With