How to test a toggle button in a menu?

How do I get the value of a “toggle button” (actually a checkbox)
in a menu? It doesn’t have an “ABW_…” pointer, presumably because
PhAB builds it dynamically.

Do I have to set the initial value of each checkbox
in a setup callback every time the menu is invoked, or can that
be made automatic via some setting in PhAB?

Thanks.

John Nagle
Team Overbot

John Nagle wrote:

How do I get the value of a “toggle button” (actually a checkbox)
in a menu? It doesn’t have an “ABW_…” pointer, presumably because
PhAB builds it dynamically.

Right; the widgets only exist when the menu is visible on the screen.

Do I have to set the initial value of each checkbox
in a setup callback every time the menu is invoked, or can that
be made automatic via some setting in PhAB?

I don’t think you can do it in PhAB, but you can do it in code, by
calling ApModifyItemState(). You can call if either from the menu’s
setup function or at any time before the menu is created.

Wojtek Lerch wrote:

John Nagle wrote:

How do I get the value of a “toggle button” (actually a checkbox)
in a menu? It doesn’t have an “ABW_…” pointer, presumably because
PhAB builds it dynamically.


Right; the widgets only exist when the menu is visible on the screen.

Do I have to set the initial value of each checkbox
in a setup callback every time the menu is invoked, or can that
be made automatic via some setting in PhAB?


I don’t think you can do it in PhAB, but you can do it in code, by
calling ApModifyItemState(). You can call if either from the menu’s
setup function or at any time before the menu is created.

OK.

Is there an access function, similar to ApModifyItemState, that
gets the values taht ApModifyItemState sets? I can’t find anything
like that in the documentation.

John Nagle
Team Overbot

John Nagle wrote:

Is there an access function, similar to ApModifyItemState, that
gets the values taht ApModifyItemState sets? I can’t find anything
like that in the documentation.

No. I guess the assumption was that you would keep track of that
yourself. The state never changes on its own – it only changes when
you call ApModifyItemState().

Wojtek Lerch wrote:

John Nagle wrote:

Is there an access function, similar to ApModifyItemState, that
gets the values taht ApModifyItemState sets? I can’t find anything
like that in the documentation.


No. I guess the assumption was that you would keep track of that
yourself. The state never changes on its own – it only changes when
you call ApModifyItemState().

Finally got menu toggles working. It’s more trouble than it’s worth.

John Nagle