Hello,
I can do that. But what I don’t understand is the first time I add items to
the list the callback is invoked. You said this is because the list gets
focus. Is there a way to give focus to the list when I delete or add items
from the keyboard handler.
Thanks for the help,
Shashank
“Wojtek Lerch” <wojtek_l@yahoo.ca> wrote in message
news:aquift$oop$1@nntp.qnx.com…
Shashank <> sbalijepalli@precitech.com> > wrote:
You are right. But I would like the callback to be invoked every time I
add
items to the list which it doen’t seem to do. I have a keyboard handler
where I delete the items and add new items.
Well, the Pt_CB_SELECTION callback has nothing to do with adding or
removing items. Its purpose is to tell you that a user action changed
the selection.
Since items can only be added or deleted from your own code, you don’t
need a callback to tell you when you’re adding or removing items. Just
call your “callback” directly whenever you’re adding or removing
items…
Thanks for all the help.
Shashank
“Wojtek Lerch” <> wojtek_l@yahoo.ca> > wrote in message
news:aqu21s$eec$> 1@nntp.qnx.com> …
Shashank <> sbalijepalli@precitech.com> > wrote:
I set the Pt_CALLBACKS_ACTIVE bit. But it still doesn’t work. Any
clues??
This has nothing to do with the Pt_CALLBACKS_ACTIVE bit. The
Pt_CALLBACKS_ACTIVE bit does not affect the Pt_CB_SELECTION callback.
Only callbacks whose docs specifically mention Pt_CALLBACKS_ACTIVE are
affected by Pt_CALLBACKS_ACTIVE. (Unless, of course, we have forgotten
to document some cases…)
What’s happening in your program is that when the widget gets focus, it
automatically selects the current item (unless, of course, there are no
items in the widget – that’s why you’re not getting the callback when
the list is empty). This behaviour can be disabled by setting
Pt_SELECTION_MODE_NOFOCUS – check the docs for Pt_ARG_SELECTION_MODE
for details.
Shashank
“Rodney Lott” <> rlott@fct.ca> > wrote in message
news:aqtkab$5do$> 1@inn.qnx.com> …
Hello.
You might want to take a look at the Pt_ARG_FLAGS bit called
Pt_CALLBACKS_ACTIVE. Generically speaking, this makes callbacks
active
if
a
widget’s value has been manipulated in code. Specifically speaking,
if
you
set this bit and then select an item from code, it will invoke the
callback.
So, when you add the new items after deleting all of the previous
ones,
you
could call PtListSelectPos() to select the first item and thus
invoke
your
callback ( given that the Pt_CALLBACKS_ACTIVE bit is set ).
Regards.
Rodney Lott
“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:aqtj2l$45n$> 1@inn.qnx.com> …
Hi,
I am using a PtList widget in my program and adding some strings
to
the
list
using the PtListAddItems() function. The selection
mode(Pt_ARG_SEL_MODE)
for
the list is the Browse mode and I have defined a Pt_CB_SELECTION
callback
where I keep track of the item_count and item_postion. The first
time
I
display the items it invokes this callback. But if I delete all
the
items
and call the PtListAddItems() with a different set of strings it
fails
to
invoke the callback until I hit the Up/Down keys.
Your help is appreciated.
Thank you,
Shashank
\
Wojtek Lerch QNX Software Systems
Ltd.
\
Wojtek Lerch QNX Software Systems Ltd.