예제 #1
0
int				ft_select(int ac, char **av, t_select *params)
{
	fputs("cl");
	if (!(params = init_list(ac, av, params)))
		return (-1);
	ft_get_col_n(params);
	ft_check_size(params);
	save_term(params, 0);
	get_key(params);
	return (0);
}
예제 #2
0
파일: main.c 프로젝트: Zained/42-select
int		ft_loop(char **av, t_truc *c)
{
	ft_argv_list(av, c);
	if (!ft_check_size(c))
		ft_print_list(c);
	ft_restruct(c, 0);
	while (1)
	{
		if (!ft_command(c))
			return (0);
	}
	return (0);
}
예제 #3
0
void	term_event(unsigned int key, t_caps *caps)
{
	if (key == 27)
		ft_exit(caps, 1);
	else if (ft_check_size(caps) == -1)
		return ;
	else if (key == 4345627)
		move_down(caps);
	else if (key == 4280091)
		move_top(caps);
	else if (key == 32)
		ft_select(caps);
	else if (key == 127 || key == 2117294875)
		ft_delete(caps);
	else if (key == 10 || key == 5066523)
		ft_return(caps);
}
예제 #4
0
void	re_draw(t_caps *caps)
{
	int			li;
	t_select	*choices;

	choices = caps->head;
	while (1)
	{
		choices->li = choices->posl;
		choices->co = choices->posc;
		if (choices == caps->tail)
			break ;
		choices = choices->next;
	}
	term_init();
	li = tgetnum("li");
	if (caps->size > li)
		list_re_init(caps, li);
	choices = caps->head;
	if (ft_check_size(caps) == -1)
		return ;
	re_draw2(caps);
}