void add_window_at_pos(struct terminal *term, void (*handler)(struct window *, struct event *, int), void *data, struct window *at) { struct event ev = {EV_INIT, 0, 0, 0}; struct window *win; ev.x = term->x; ev.y = term->y; win = mem_alloc(sizeof (struct window)); win->handler = handler; win->data = data; win->term = term; win->xp = win->yp = 0; add_at_pos(at, win); win->handler(win, &ev, 0); }
void *block_url_add(struct session *ses, unsigned char *url) { /*Callback from the dialog box created from the link menu*/ struct block* new_b; struct terminal *term = ses ? ses->term : NULL; if (test_list_window_in_use(&blocks_ld, term)) return NULL; new_b = block_new_item(0); if (new_b->url) mem_free(new_b->url); new_b->url = stracpy(url); new_b->type = 0; add_at_pos((struct block *)blocks_ld.list->prev, new_b); return NULL; }