Nano-x load desktop image lxde

Source: Internet
Author: User


# 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;

}

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.