Hello world/Graphical: Difference between revisions
→{{header|Sidef}}: added Gtk3 example
m (→{{header|Wren}}: Changed to Wren S/H) |
(→{{header|Sidef}}: added Gtk3 example) |
||
Line 3,859:
=={{header|Sidef}}==
{{libheader|Tk}}
<syntaxhighlight lang="ruby">var tk = require('Tk')
var main = %
main.Button(
'-text' => 'Goodbye, World!',
'-command' => 'exit',
).pack
tk.MainLoop
{{libheader|Gtk2}}
<syntaxhighlight lang="ruby">var gtk2 = require('Gtk2') -> init
window.show_all
{{libheader|Gtk3}}
▲var window = %s'Gtk2::Window'.new;
<syntaxhighlight lang="ruby">use('Gtk3 -init')
▲var label = %s'Gtk2::Label'.new('Goodbye, World!');
var gtk3 = %O'Gtk3'
▲window.set_title('Goodbye, World!');
var window = %O'Gtk3::Window'.new
▲window.signal_connect(destroy => func(*_){ gtk2.main_quit });
var label = %O'Gtk3::Label'.new('Goodbye, World!')
window.
window.signal_connect(destroy => { gtk3.main_quit })
▲window.show_all;
window.add(label)
▲gtk2.main;</syntaxhighlight>
window.show_all
gtk3.main</syntaxhighlight>
=={{header|Slope}}==
|