Python Forum
[Tkinter] [split] [split] How to make a window stay on top
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] [split] [split] How to make a window stay on top
#5
(Apr-25-2021, 01:59 AM)BashBedlam Wrote: In this example, the text_entry widget is set to have focus as soon as the toplevel window opens. Is this what you're looking for?

from tkinter import Tk, Toplevel, Button, Label, Text
 
def open_a_toplevel_window () :
	toplevel_window = Toplevel (root)
	toplevel_window.title ('Focusing on Text Entery')
	toplevel_window.geometry ('270x100')
	label = Label(toplevel_window, text = 'Enter Text Now')
	label.pack()
	text_entry = Text (toplevel_window, width = 10, height = 3)
	text_entry.focus_set ()
	text_entry.pack ()
	toplevel_window.attributes ('-topmost', True)
	toplevel_window.mainloop()
 
root = Tk ()
root.title ("Root Window")  
root.geometry ("400x200")  
label1 = Label (root, text = "This is the Root Window")
button = Button (root, text = "Open Toplevel Window")
button.config (command = open_a_toplevel_window)
label1.pack ()
button.place (x = 110, y = 50)
root.mainloop ()

That is playing more nicely. Many thanks.
Reply


Messages In This Thread
RE: [split] [split] How to make a window stay on top - by knoxvilles_joker - Apr-25-2021, 02:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Interaction between Matplotlib window, Python prompt and TKinter window NorbertMoussy 3 955 Mar-17-2024, 09:37 AM
Last Post: deanhystad
  [Tkinter] [split] I want to add a code to the "Save" button to save the data entered LOO 1 2,138 Jan-23-2023, 05:31 PM
Last Post: deanhystad
Question [Tkinter] How to make split button? teknixstuff 2 1,188 Jan-03-2023, 06:21 PM
Last Post: Yoriz
  [split] .delete and .insert not working brigette 5 2,161 Jul-21-2022, 07:46 PM
Last Post: menator01
  [Tkinter] [split] Is there a way to embed a treeview as a row inside another treeview? CyKlop 5 3,571 Oct-20-2021, 12:14 AM
Last Post: CyKlop
  Trying to make random image loop in Tk window using python Jediguy18 1 3,342 Dec-30-2020, 04:56 AM
Last Post: deanhystad
  [Tkinter] How to make message box error stay on top of window scratchmyhead 1 8,627 May-10-2020, 10:21 PM
Last Post: scratchmyhead
  tkinter window and turtle window error 1885 3 6,925 Nov-02-2019, 12:18 PM
Last Post: 1885
  [split] What is a GUI's mainloop ? kom2 1 2,839 May-04-2019, 01:58 PM
Last Post: Yoriz
  [Tkinter] [split] need help in optionMenu using tkinter Rakeshkrtiwari_07 0 2,322 Aug-02-2018, 04:16 PM
Last Post: Rakeshkrtiwari_07

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020