Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "osxstep.h"
- inputbox_t *iuser, *ipass;
- label_t *luser, *lpass;
- int quitf(void *p1, void *p2)
- {
- return (XSAppQuit());
- }
- int buttonf(void *p1, void *p2)
- {
- static int bt=0;
- char name[128];
- widget_t *button = (widget_t *)p1;
- sprintf(name, "click %d", ++bt);
- button_set_text(button, name);
- printf("button press: %x, %s\n", (unsigned int)button->tag, name);
- return (1);
- }
- int getinput(void *p1, void *p2)
- {
- char *user = inputbox_get_text(iuser);
- char *pass = inputbox_get_text(ipass);
- printf("username: %s, password: %s\n", user, pass);
- return (1);
- }
- int main(int argc, const char **argv)
- {
- screen_t *screen;
- window_t *window;
- button_t *button;
- label_t *label;
- box_t *box;
- XSAppInit();
- screen = screen_create(0,0);
- window = window_create(screen, 320, 240, 160, 160," window teste 1 ", 0);
- box = box_create(window, 295, 210, 12, 12, "box test", 0);
- label = label_create(box, 80, 15, 12, 14, "username: ", 0);
- label = label_create(box, 80, 15, 12, 34, "password: ", 0);
- iuser = inputbox_create(box, 80, 15, 95, 14, "user", 0);
- ipass = inputbox_create(box, 80, 15, 95, 34, "pass", INPUT_PASSWORD);
- button = button_create(box, 62, 18, 95 + 85, 32, " check ", &getinput);
- button = button_create(box, 62, 18, (295 - 62 - 8), (210 - 24), "quit ", &quitf);
- return (XSAppMain(screen, argc, argv));
- }
Add Comment
Please, Sign In to add comment