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

45
eugtk/examples/test86.ex Normal file
View File

@@ -0,0 +1,45 @@
-------------------------------------------------------------------------
--# Resizing Images
-- To load images at a different size than normal, load them into a
-- GdkPixbuf, then create a GtkImage from that pixbuf.
-------------------------------------------------------------------------
include GtkEngine.e
constant docs = `<u><b>Resized Image</b></u>
Original size: 525 x 360 pixels
Loaded as GdkPixbuf,
with width of 150 pixels,
HxW ratio retained.
`
constant win = create(GtkWindow,
"size=200x100,border_width=10,position=1,$destroy=Quit")
constant panel = create(GtkBox,"orientation=VERTICAL")
add(win,panel)
constant lbl = create(GtkLabel)
set(lbl,"markup",docs)
add(panel,lbl)
object pix = create(GdkPixbuf,"thumbnails/7300.jpg")
pix = get(pix,"scale simple",150,100,1)
constant img = create(GtkImage,pix)
set(img,"margin bottom",5)
add(panel,img)
constant btn1 = create(GtkButton,"gtk-quit","Quit")
pack(panel,-btn1)
show_all(win)
main()