How can I use a PtList like a PtMenu?
How can I grab the ENTER event in the PtList?
I wanna select one item in the PtList and when I press ENTER I need that execute the callback.
How can I do that?
With PtList is possible select and execute the callback using mouse pointer, I can select and execute the callback using hotkey as well, but I really don´t know how can I use the PK_Up and Pk_Dn to select one item and, after that, I press Enter and the callback is execute.


Im not sure that I understand what you need
hope this helps

[code]#include <Pt.h>
#include <stdio.h>

char *items [] = { “first”, “second”, “third” };

int list_CB_SELECTION (PtWidget_t *wgt, void *data, PtCallbackInfo_t *info)
PtListCallback_t *cbdata;
PhEvent_t *event;

if (info->reason_subtype != Pt_LIST_SELECTION_FINAL)
	return 0;

event = info->event;

if (event->type != Ph_EV_KEY)
	return 0;

cbdata = info->cbdata;

printf("selection '%s'\n", cbdata->item);

return 0;


int main ()
PtWidget_t *main_window, *list;
PtArg_t arg;
PhDim_t dim;

if (!(main_window = PtAppInit(NULL, NULL, NULL, 0, NULL)))
	return -1;

if (!(list = PtCreateWidget(PtList, main_window, 0, NULL)))
	return -1;

if (PtListAddItems(list, items, 3, 1) == -1)
	return -1;

PtAddCallback(list, Pt_CB_SELECTION, list_CB_SELECTION, NULL);
PtSetArg(&arg, Pt_ARG_DIM, &dim, 0);
dim.w = 150;
dim.h = 250;
PtSetResources(main_window, 1, &arg);
dim.w = 100;
dim.h = 200;
PtSetResources(list, 1, &arg);


return 0;


That was IT.

Thank you VERY MUCH.