Hello world/Graphical: Difference between revisions

Content added Content deleted
m (→‎{{header|Wren}}: Changed to Wren S/H)
(→‎{{header|Sidef}}: added Gtk3 example)
Line 3,859: Line 3,859:
=={{header|Sidef}}==
=={{header|Sidef}}==
{{libheader|Tk}}
{{libheader|Tk}}
<syntaxhighlight lang="ruby">var tk = require('Tk');
<syntaxhighlight lang="ruby">var tk = require('Tk')
var main = %s'MainWindow'.new;
var main = %O<MainWindow>.new
main.Button(
main.Button(
'-text' => 'Goodbye, World!',
'-text' => 'Goodbye, World!',
'-command' => 'exit',
'-command' => 'exit',
).pack;
).pack
tk.MainLoop;</syntaxhighlight>
tk.MainLoop</syntaxhighlight>


{{libheader|Gtk2}}
{{libheader|Gtk2}}
<syntaxhighlight lang="ruby">var gtk2 = require('Gtk2') -> init;
<syntaxhighlight lang="ruby">var gtk2 = require('Gtk2') -> init
 
var window = %O<Gtk2::Window>.new
var label = %O<Gtk2::Label>.new('Goodbye, World!')
 
window.set_title('Goodbye, World!')
window.signal_connect(destroy => { gtk2.main_quit })
 
window.add(label)
window.show_all
 
gtk2.main</syntaxhighlight>


{{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.add(label);
window.set_title('Goodbye, World!')
window.signal_connect(destroy => { gtk3.main_quit })
window.show_all;


window.add(label)
gtk2.main;</syntaxhighlight>
window.show_all

gtk3.main</syntaxhighlight>


=={{header|Slope}}==
=={{header|Slope}}==