# Include <stdio. h>
# Include <string. h>
# Include <stdlib. h>
# Include "nano-X.h"
# Include "nxcolors. H"
Gr_window_id WID;
Gr_gc_id GC;
Int J = 0;
Int x = 0;
Int y = 0;
Void event_handler (gr_event * event );
Int main (void)
{
If (gropen () <0)
{
Fprintf (stderr, "gropen failed ");
Return-1;
}
GC = grnewgc ();
Grsetgcforeground (GC, gr_color_red); // foreground color (font color)
Grsetgcbackground (GC, gr_color_green); // background color (font background color)
WID = grnewjavaswex (gr_wm_props_appframe | gr_wm_props_caption | gr_wm_props_closebox, "uunubt nano-X", gr_root_window_id, 0, 0,640,480, gr_color_royalblue );
Grselectevents (WID, gr_event_mask_close_req | gr_event_mask_exposure );
Grmapwindow (WID );
Grdrawimagefromfile (WID, GC, 640,480, "/home/Daiwei/devazbox_by_leandrpf/microwin/src/demos/nanox/logo1.jpg", 0 );
// Grdelay (2000 );
Grdrawimagefromfile (WID, GC, 640,480, "/home/Daiwei/devazbox_by_leandrpf/microwin/src/demos/nanox/logo2.jpg", 0 );
// Grdelay (2000 );
Grdrawimagefromfile (WID, GC, 640,480, "/home/Daiwei/devazbox_by_leandrpf/microwin/src/demos/nanox/logo3.jpg", 0 );
Grtext (WID, GC, 0,460, "Hello World uunubt! ",-1, gr_tfascii );
For (;;)
{
X ++;
Grtext (WID, GC, X, 460, "Hello World uunubt! ",-1, gr_tfascii );
Grdelay (10 );
If (x> 640)
{X = 0 ;}
};
Grmainloop (event_handler );
Return 0;
}
Void event_handler (gr_event * event)
{
Switch (Event-> type)
{
Case gr_event_type_exposure:
If (j <3)
{
; // Grtext (WID, GC, 150,150, "Hello World",-1, gr_tfascii );
}
Else
{
;
}
Break;
Case gr_event_type_close_req:
Grclose ();
Default: break;
}
}