Gtk GUI + returning a value from a function

,

Hi,

I’m using Gtk to display GUI inside my function. I’d like the function to return a value generated in that GUI, e.g. Gtk.GtkSpinButton value. How can this be done? I need to keep the window open until the value is set and confirmed by the user and then to close the window and return the value.

ATB,
Adam

Ok, I think I’ve got it:

@async Gtk.gtk_main()
Gtk.waitforsignal(win, :destroy)
return get_gtk_property(sb_entry, :value, Float64)
2 Likes

Please keep posting more stuff about GUIs, this forum is seriously lacking in examples.

2 Likes