this should do the trick!
(这应该可以解决问题!)
using Gtk
win = GtkWindow("My First Gtk.jl Program", 400, 200)
a = GtkImage("path_to_image_file")
push!(win,a)
showall(win)
Note that I am not sure if it can render in the same window as the button you mentioned since I get the following error when I have a button and then push the image:
(请注意,我不确定它是否可以与您提到的按钮在同一窗口中呈现,因为当我有一个按钮然后按下图像时出现以下错误:)
(<unknown>:69811): Gtk-WARNING **: 15:34:18.724: Attempting to add a widget with type GtkImage to a GtkWindow, but as a GtkBin subclass a GtkWindow can only contain one widget at a time; it already contains a widget of type GtkButton
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…