Simple windowed application: Difference between revisions
Content added Content deleted
m (update for newer Gtk version) |
|||
Line 1,813: | Line 1,813: | ||
=={{header|Julia}}== |
=={{header|Julia}}== |
||
Uses the Gtk library. |
Uses the Gtk library. |
||
<lang julia> |
<lang julia>using Gtk.ShortNames |
||
using Gtk.ShortNames |
|||
function clickwindow() |
function clickwindow() |
||
Line 1,824: | Line 1,822: | ||
push!(vbox, lab) |
push!(vbox, lab) |
||
push!(vbox, but) |
push!(vbox, but) |
||
set_gtk_property!(vbox, :expand, lab, true) |
|||
set_gtk_property!(vbox, :spacing, 20) |
|||
callback(w) = (clicks += 1; |
callback(w) = (clicks += 1; set_gtk_property!(lab, :label, "There have been $clicks button clicks.")) |
||
id = signal_connect(callback, but, |
id = signal_connect(callback, but, :clicked) |
||
⚫ | |||
c = Condition() |
c = Condition() |
||
endit(w) = notify(c) |
endit(w) = notify(c) |
||
signal_connect(endit, win, :destroy) |
signal_connect(endit, win, :destroy) |
||
⚫ | |||
wait(c) |
wait(c) |
||
end |
end |
||
clickwindow() |
clickwindow() |