Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
33
Task/Window-creation/Forth/window-creation-1.fth
Normal file
33
Task/Window-creation/Forth/window-creation-1.fth
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
include ffl/gsv.fs
|
||||
|
||||
\ Open the connection to the gtk-server and load the Gtk2 definitions
|
||||
s" gtk-server.cfg" s" ffl-fifo" gsv+open 0= [IF]
|
||||
|
||||
\ Convert the string event to a widget id
|
||||
: event>widget
|
||||
0. 2swap >number 2drop d>s
|
||||
;
|
||||
|
||||
0 value window
|
||||
|
||||
: window-creation
|
||||
gtk_init
|
||||
|
||||
\ Create the window
|
||||
GTK_WINDOW_TOPLEVEL gtk_window_new to window
|
||||
|
||||
window gtk_widget_show
|
||||
|
||||
\ Wait for an event
|
||||
BEGIN
|
||||
s" WAIT" gtk_server_callback
|
||||
event>widget window =
|
||||
UNTIL
|
||||
|
||||
0 gtk_exit
|
||||
;
|
||||
|
||||
window-creation
|
||||
|
||||
gsv+close drop
|
||||
[THEN]
|
||||
5
Task/Window-creation/Forth/window-creation-2.fth
Normal file
5
Task/Window-creation/Forth/window-creation-2.fth
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
Window+ w \ create a window
|
||||
View v \ create a view
|
||||
300 30 430 230 put: frameRect \ size a rectangle for the view
|
||||
frameRect " Test" docWindow v new: w \ activate the view and window
|
||||
show: w \ display the window
|
||||
Loading…
Add table
Add a link
Reference in a new issue