Gtk does not work well in VSCode

Anybody try Gtk.jl, It works well in Jupyter . But when I try it in VSCode, it generate some errors.

using Gtk


Gtk.init()

# Create a main window
win = GtkWindow("TextField and Button Example", 300, 100)

# Handle the window close event properly
signal_connect(win, "destroy") do widget
    Gtk.quit()
end

# Show the window
showall(win)

# Run the Gtk event loop to keep the window open
Gtk.gtk_main()

It show errors in Base.jl

Exception has occurred: UndefVarError
UndefVarError: init not defined in Gtk

Stacktrace:
[1] getproperty(x::Module, f::Symbol)
@ Base Base.jl:42
[2] top-level scope

The issue isn’t in Base.jl, that error is just saying the Gtk module doesn’t have the init name at runtime you expected. My first guess would be that you’re using different versions of Gtk.jl, and init was removed for one of them. It suggests you move to Gtk4.jl because it’s no longer supported, so you should do that if you don’t need to reproduce old code.