September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
11
Task/Hello-world-Graphical/BaCon/hello-world-graphical.bacon
Normal file
11
Task/Hello-world-Graphical/BaCon/hello-world-graphical.bacon
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
REM GUI greeting
|
||||
|
||||
INCLUDE "hug.bac"
|
||||
|
||||
mainwindow = WINDOW("BaCon greeting", 225, 40)
|
||||
|
||||
greeting = ENTRY("Goodbye, World!", 115, 30)
|
||||
ATTACH(mainwindow, greeting, 5, 5)
|
||||
|
||||
REM gtk event loop...
|
||||
DISPLAY
|
||||
|
|
@ -1,19 +1,62 @@
|
|||
program-id. ghello.
|
||||
data division.
|
||||
working-storage section.
|
||||
01 var pic x(1).
|
||||
01 lynz pic 9(3).
|
||||
01 colz pic 9(3).
|
||||
01 msg pic x(15) value "Goodbye, world!".
|
||||
procedure division.
|
||||
accept lynz from lines end-accept
|
||||
divide lynz by 2 giving lynz.
|
||||
accept colz from columns end-accept
|
||||
divide colz by 2 giving colz.
|
||||
subtract 7 from colz giving colz.
|
||||
display msg
|
||||
at line number lynz
|
||||
column number colz
|
||||
end-display
|
||||
accept var end-accept
|
||||
stop run.
|
||||
*>
|
||||
*> cobweb-gui-hello, using gtk-label
|
||||
*> Tectonics:
|
||||
*> cobc -w -xj cobweb-gui-hello.cob cobweb-gtk.cob \
|
||||
*> `pkg-config --libs gtk+-3.0`
|
||||
*>
|
||||
identification division.
|
||||
program-id. cobweb-gui-hello.
|
||||
|
||||
environment division.
|
||||
configuration section.
|
||||
repository.
|
||||
function new-window
|
||||
function new-box
|
||||
function new-label
|
||||
function gtk-go
|
||||
function all intrinsic.
|
||||
|
||||
data division.
|
||||
working-storage section.
|
||||
|
||||
01 TOPLEVEL usage binary-long value 0.
|
||||
01 HORIZONTAL usage binary-long value 0.
|
||||
01 VERTICAL usage binary-long value 1.
|
||||
|
||||
01 width-hint usage binary-long value 160.
|
||||
01 height-hint usage binary-long value 16.
|
||||
|
||||
01 spacing usage binary-long value 8.
|
||||
01 homogeneous usage binary-long value 0.
|
||||
|
||||
01 extraneous usage binary-long.
|
||||
|
||||
01 gtk-window-data.
|
||||
05 gtk-window usage pointer.
|
||||
01 gtk-container-data.
|
||||
05 gtk-container usage pointer.
|
||||
|
||||
01 gtk-box-data.
|
||||
05 gtk-box usage pointer.
|
||||
01 gtk-label-data.
|
||||
05 gtk-label usage pointer.
|
||||
|
||||
procedure division.
|
||||
cobweb-hello-main.
|
||||
|
||||
*> Main window and top level container
|
||||
move new-window("Hello", TOPLEVEL, width-hint, height-hint)
|
||||
to gtk-window-data
|
||||
move new-box(gtk-window, VERTICAL, spacing, homogeneous)
|
||||
to gtk-container-data
|
||||
|
||||
*> Box, across, with simple label
|
||||
move new-box(gtk-container, HORIZONTAL, spacing, homogeneous)
|
||||
to gtk-box-data
|
||||
move new-label(gtk-box, "Goodbye, World!") to gtk-label-data
|
||||
|
||||
*> GTK+ event loop now takes over
|
||||
move gtk-go(gtk-window) to extraneous
|
||||
|
||||
goback.
|
||||
end program cobweb-gui-hello.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
program-id. ghello.
|
||||
data division.
|
||||
working-storage section.
|
||||
01 var pic x(1).
|
||||
01 lynz pic 9(3).
|
||||
01 colz pic 9(3).
|
||||
01 msg pic x(15) value "Goodbye, world!".
|
||||
procedure division.
|
||||
accept lynz from lines end-accept
|
||||
divide lynz by 2 giving lynz.
|
||||
accept colz from columns end-accept
|
||||
divide colz by 2 giving colz.
|
||||
subtract 7 from colz giving colz.
|
||||
display msg
|
||||
at line number lynz
|
||||
column number colz
|
||||
end-display
|
||||
accept var end-accept
|
||||
stop run.
|
||||
2
Task/Hello-world-Graphical/EC/hello-world-graphical-1.ec
Normal file
2
Task/Hello-world-Graphical/EC/hello-world-graphical-1.ec
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
import "ecere"
|
||||
MessageBox goodBye { contents = "Goodbye, World!" };
|
||||
2
Task/Hello-world-Graphical/EC/hello-world-graphical-2.ec
Normal file
2
Task/Hello-world-Graphical/EC/hello-world-graphical-2.ec
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
import "ecere"
|
||||
Label label { text = "Goodbye, World!", hasClose = true, opacity = 1, size = { 320, 200 } };
|
||||
15
Task/Hello-world-Graphical/EC/hello-world-graphical-3.ec
Normal file
15
Task/Hello-world-Graphical/EC/hello-world-graphical-3.ec
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import "ecere"
|
||||
|
||||
class GoodByeForm : Window
|
||||
{
|
||||
text = "Goodbye, World!";
|
||||
size = { 320, 200 };
|
||||
hasClose = true;
|
||||
|
||||
void OnRedraw(Surface surface)
|
||||
{
|
||||
surface.WriteTextf(10, 10, "Goodbye, World!");
|
||||
}
|
||||
}
|
||||
|
||||
GoodByeForm form {};
|
||||
|
|
@ -1,31 +1,33 @@
|
|||
#import forms.
|
||||
#import system.
|
||||
import forms.
|
||||
|
||||
#class Window :: SDIDialog
|
||||
class Window :: SDIDialog
|
||||
{
|
||||
#field goodByeWorldLabel.
|
||||
#field closeButton.
|
||||
object goodByeWorldLabel.
|
||||
object closeButton.
|
||||
|
||||
#constructor new <= (new)
|
||||
constructor new
|
||||
<= new;
|
||||
[
|
||||
goodByeWorldLabel := Label new.
|
||||
closeButton := Button new.
|
||||
|
||||
theControls append:goodByeWorldLabel.
|
||||
theControls append:closeButton.
|
||||
theControls
|
||||
append:goodByeWorldLabel;
|
||||
append:closeButton.
|
||||
|
||||
$self set &x:250 &y:200.
|
||||
$self set &width:200 &height:110.
|
||||
$self
|
||||
set x:250 y:200;
|
||||
set width:200 height:110.
|
||||
|
||||
goodByeWorldLabel set &x:40 &y:10.
|
||||
goodByeWorldLabel set &width:150 &height:30.
|
||||
goodByeWorldLabel set &caption:"Goodbye, World!".
|
||||
goodByeWorldLabel
|
||||
set x:40 y:10;
|
||||
set width:150 height:30;
|
||||
set caption:"Goodbye, World!".
|
||||
|
||||
closeButton set &x:20 &y:40.
|
||||
closeButton set &width:150 &height:30.
|
||||
closeButton set &caption:"Close".
|
||||
|
||||
closeButton set &onClick:args
|
||||
[ 'program stop. ].
|
||||
closeButton
|
||||
set x:20 y:40;
|
||||
set width:150 height:30;
|
||||
set caption:"Close";
|
||||
set onClick(:args)[ 'program stop ]
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
WRITE(Messagebox='!') 'Goodbye, World!'
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
link graphics
|
||||
procedure main()
|
||||
WOpen("size=100,20") | stop("No window")
|
||||
WWrites("Goodbye, World!")
|
||||
WDone()
|
||||
end
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
import gui
|
||||
$include "guih.icn"
|
||||
|
||||
class WindowApp : Dialog ()
|
||||
|
||||
# -- automatically called when the dialog is created
|
||||
method component_setup ()
|
||||
# add 'hello world' label
|
||||
label := Label("label=Hello world","pos=0,0")
|
||||
add (label)
|
||||
|
||||
# make sure we respond to close event
|
||||
connect(self, "dispose", CLOSE_BUTTON_EVENT)
|
||||
end
|
||||
end
|
||||
|
||||
# create and show the window
|
||||
procedure main ()
|
||||
w := WindowApp ()
|
||||
w.show_modal ()
|
||||
end
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
DEF Win:WINDOW
|
||||
DEF Close:CHAR
|
||||
DEF ScreenSizeX,ScreenSizeY:UINT
|
||||
|
||||
GETSCREENSIZE(ScreenSizeX,ScreenSizeY)
|
||||
|
||||
OPENWINDOW Win,0,0,ScreenSizeX,ScreenSizeY,NULL,NULL,"Goodbye program",&MainHandler
|
||||
|
||||
PRINT Win,"Goodbye, World!"
|
||||
'Prints in upper left corner of the window (position 0,0).
|
||||
|
||||
WAITUNTIL Close=1
|
||||
|
||||
CLOSEWINDOW Win
|
||||
|
||||
END
|
||||
|
||||
SUB MainHandler
|
||||
|
||||
IF @MESSAGE=@IDCLOSEWINDOW THEN Close=1
|
||||
|
||||
RETURN
|
||||
ENDSUB
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
alias goodbyegui {
|
||||
dialog -m Goodbye Goodbye
|
||||
}
|
||||
|
||||
dialog Goodbye {
|
||||
title "Goodbye, World!"
|
||||
size -1 -1 80 20
|
||||
option dbu
|
||||
text "Goodbye, World!", 1, 20 6 41 7
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
; hello-gui.lsp
|
||||
; oofoe 2012-01-18
|
||||
|
||||
; Initialize GUI server.
|
||||
(load (append (env "NEWLISPDIR") "/guiserver.lsp"))
|
||||
(gs:init)
|
||||
|
||||
; Create window frame.
|
||||
(gs:frame 'Goodbye 100 100 300 200 "Goodbye!")
|
||||
(gs:set-resizable 'Goodbye nil)
|
||||
(gs:set-flow-layout 'Goodbye "center")
|
||||
|
||||
; Add final message.
|
||||
(gs:label 'Message "Goodbye, World!" "center")
|
||||
(gs:add-to 'Goodbye 'Message)
|
||||
|
||||
; Show frame.
|
||||
(gs:set-visible 'Goodbye true)
|
||||
|
||||
; Start event loop.
|
||||
(gs:listen)
|
||||
|
||||
(exit) ; NewLisp normally goes to listener after running script.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
include pGUI.e
|
||||
IupOpen("demo/pGUI/")
|
||||
IupOpen()
|
||||
IupMessage("Bye","Goodbye, World!")
|
||||
IupClose()
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
messagebox("Goodbye, World!")
|
||||
|
|
@ -0,0 +1 @@
|
|||
window stopbox note "Goodbye, World!"
|
||||
4
Task/Hello-world-Graphical/TXR/hello-world-graphical.txr
Normal file
4
Task/Hello-world-Graphical/TXR/hello-world-graphical.txr
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(with-dyn-lib "user32.dll"
|
||||
(deffi messagebox "MessageBoxW" int (cptr wstr wstr uint)))
|
||||
|
||||
(messagebox cptr-null "Hello" "World" 0) ;; 0 is MB_OK
|
||||
3
Task/Hello-world-Graphical/Zkl/hello-world-graphical.zkl
Normal file
3
Task/Hello-world-Graphical/Zkl/hello-world-graphical.zkl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
System.cmd(0'|zenity --info --text="Goodbye, World!"|); // GTK+ pop up
|
||||
System.cmd(0'|notify-send "Goodbye, World!"|); // desktop notification
|
||||
System.cmd(0'|xmessage -buttons Ok:0,"Not sure":1,Cancel:2 -default Ok -nearmouse "Goodbye, World!" -timeout 10|); // X Windows dialog
|
||||
Loading…
Add table
Add a link
Reference in a new issue