eumandy/eugtk/examples/test74.ex
2016-11-25 00:33:18 -07:00

30 lines
742 B
Elixir

--------------------------------------------------
--# Display dimensions
--------------------------------------------------
include GtkEngine.e
atom disp = create(GdkDisplay)
atom scrn = get(disp,"default screen")
constant win = create(GtkWindow,"size=200x100,border_width=5,position=1,$destroy=Quit")
constant panel = create(GtkBox,VERTICAL)
add(win,panel)
object icon = valid_icon_name({"video-display","computer","screen","cs-screen"})
add(panel,create(GtkImage,icon,GTK_ICON_SIZE_DIALOG))
constant lbl = create(GtkLabel,
sprintf("Screen Dimensions:\n %d x %d",{get(scrn,"width"),get(scrn,"height")}))
add(panel,lbl)
constant btn = create(GtkButton,"gtk-quit","Quit")
pack(panel,-btn)
show_all(win)
main()