Tk.jl icon indicating copy to clipboard operation
Tk.jl copied to clipboard

How to add a scrollbar to text?

Open AwesomeQuest opened this issue 11 months ago • 0 comments

Hi, I'm very new to Tkinter and I need some help. In the examples online on how to bind a scrollbar to a text element they always use the following code.

txt['yscrollcommand']=scrollbar.set
scrollbar.config(command=txt.yview)

What I can't figure out is how to find the scrollbar.set and txt.yview methods since Tk.jl doesn't provide the methods as properties.

scrollbar[:set] and txt[:yview] don't work.

Here's an example of the layout I'm trying to have

using Tk
w = Toplevel("Robot Controller")
windowframe = Frame(w)
pack(windowframe, side="top", fill="both")

txt = Tk.Text(windowframe, width=40,height=5)
pack(txt, side="left")
scrollbar = Tk.Scrollbar(windowframe)
pack(scrollbar, side="left", fill="y")

I've also been running into this issue of finding methods in most of the other examples online.

AwesomeQuest avatar May 04 '25 11:05 AwesomeQuest