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 = % |
var main = %O<MainWindow>.new |
||
main.Button( |
main.Button( |
||
'-text' => 'Goodbye, World!', |
'-text' => 'Goodbye, World!', |
||
'-command' => 'exit', |
'-command' => 'exit', |
||
).pack |
).pack |
||
tk.MainLoop |
tk.MainLoop</syntaxhighlight> |
||
{{libheader|Gtk2}} |
{{libheader|Gtk2}} |
||
<syntaxhighlight lang="ruby">var gtk2 = require('Gtk2') -> init |
<syntaxhighlight lang="ruby">var gtk2 = require('Gtk2') -> init |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
window.show_all |
|||
⚫ | |||
{{libheader|Gtk3}} |
|||
⚫ | |||
<syntaxhighlight lang="ruby">use('Gtk3 -init') |
|||
⚫ | |||
var gtk3 = %O'Gtk3' |
|||
⚫ | |||
var window = %O'Gtk3::Window'.new |
|||
⚫ | |||
var label = %O'Gtk3::Label'.new('Goodbye, World!') |
|||
window. |
window.set_title('Goodbye, World!') |
||
window.signal_connect(destroy => { gtk3.main_quit }) |
|||
⚫ | |||
window.add(label) |
|||
⚫ | |||
window.show_all |
|||
gtk3.main</syntaxhighlight> |
|||
=={{header|Slope}}== |
=={{header|Slope}}== |