------------------------------------------------------------------------------ --# Display size, mouse location within window, etc. ------------------------------------------------------------------------------ include GtkEngine.e atom disp = create(GdkDisplay) atom scrn = get(disp,"default screen") constant win = create(GtkWindow, "size=200x100,border_width=10,position=1,icon=gnome-run,$destroy=Quit") constant panel = create(GtkBox,VERTICAL,10) add(win,panel) constant top = create(GtkBox,HORIZONTAL,10) add(panel,top) constant pix = create(GdkPixbuf,"thumbnails/gnome-run.png",100,100,1) constant img = create(GtkImage,pix) add(top,img) constant lbl = create(GtkLabel, "markup='Show info about computer display\nMove window, click OK button'") add(top,lbl) constant btn1 = create(GtkButton,"gtk-quit","Quit"), btn2 = create(GtkButton,"gtk-ok","ShowStats"), btnbox = create(GtkButtonBox) add(btnbox,{btn1,btn2}) pack(panel,-btnbox) show_all(win) main() --------------------------------------------------- global function ShowStats() --------------------------------------------------- object pointer_loc = get(win,"pointer"), cursor_size = get(disp,"maximal cursor size"), shapes = get(disp,"supports shapes"), composite = get(disp,"supports composite"), scrn_dim = {get(scrn,"width"),get(scrn,"height")}, size = get(win,"size"), pos = get(win,"position") set(lbl,"markup",format(` Pointer location:[]x[] Cursor size:[]x[] Supports shapes:[] Supports composite:[] Screen dimensions:[]x[] Window size: []x[] Window position: []x[]`, flatten(pointer_loc & cursor_size & shapes & composite & scrn_dim & size & pos))) return 1 end function