PtComboBox Item Selection

Hello,

I have the feeling that I’m going get burned by Mario for asking this question, but here goes anyways. :confused:

Whenever my base window loads up, I want it to read from a file the item selected previously. Then I want it to use that item position number to display the contents of combobox.

Ex. I select item in position 2, write the item position to file. When it opens again, read position from file. Then I want item in position 2 to be displayed on the GUI.

I have no problems reading the item position using Pt_ARG_CBOX_SEL_ITEM and writing it to file, but when I load a position number (when opening my GUI), it doesn’t display the item on the GUI (it always displays the first item).

Here’s how I’m loading the item select position:

int pos;
pos = 2;
PtSetResource(ABW_MY_COMBOBOX,Pt_ARG_CBOX_SEL_ITEM,&pos,0);
PtFlush();

Any help would be great. Thanks!

Instead of &pos, just put pos. you don’t need to pass in pointer but rather a value in this case

Thanks again Jinma! It’s been a rough day for me.

But at least I didn`t burn you, lol!