Jump to content

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 = %s'O<MainWindow'>.new;
main.Button(
'-text' => 'Goodbye, World!',
'-command' => 'exit',
).pack;
tk.MainLoop;</syntaxhighlight>
 
{{libheader|Gtk2}}
<syntaxhighlight lang="ruby">var gtk2 = require('Gtk2') -> init;
 
var window = %s'O<Gtk2::Window'>.new;
var label = %s'O<Gtk2::Label'>.new('Goodbye, World!');
 
window.set_title('Goodbye, World!');
window.signal_connect(destroy => func(*_){ gtk2.main_quit });
 
window.show_all;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.addset_title(label'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}}==
2,747

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.