added eugtk examples

This commit is contained in:
2016-11-25 00:33:18 -07:00
parent 87a821e3da
commit c0b98b619e
877 changed files with 96872 additions and 0 deletions

38
eugtk/examples/test2.ex Normal file
View File

@@ -0,0 +1,38 @@
------------------------------------------------------------------------
--# How to use a custom cursor;
------------------------------------------------------------------------
include GtkEngine.e
constant goose = locate_file("thumbnails/mongoose.png") -- image to use for cursor;
constant win = create(GtkWindow,
"title=OpenEuphoria,border=10,position=1,icon=face-smile,$destroy=Quit")
constant panel = create(GtkBox,"orientation=VERTICAL")
add(win,panel)
constant img = create(GtkImage,"thumbnails/euphoria.gif")
add(panel,img)
show_all(win)
------------------------------------------------------------
-- custom cursors must be created AFTER the window they are
-- to be used in is instantiated (a.k.a. shown)
------------------------------------------------------------
constant -- create custom cursor from image file;
pix = create(GdkPixbuf,goose,32,32) -- size 32x32px;
set(win,"cursor",pix,12,5) -- location of 'hot spot';
-- if you prefer a pre-built cursor, use one of the enums in
-- GtkEnums:
-- set(win,"cursor",GDK_WATCH)
-- this can also be used as a 'wait' indication while some long
-- process takes place...
main()