How to set/reset PtToggleButton

Dear all

Can a PtToggleButton be set and reset from code using the Pt_SET flag. I
have tried and it does not seem to work. I could be doing something wrong in
setting the Pt_ARG_FLAG resource but I think that side of it is working.

Is this the reason for the PtOnOffButton which can be easily set/reset.

Rod

CSIRO Minerals

all

It’s OK I was not setting the flag correctly. Learn something new every day.

Rod

“Rodney Stevens” <rod.stevens@csiro.au> wrote in message
news:c79344$d0i$1@inn.qnx.com

Dear all

Can a PtToggleButton be set and reset from code using the Pt_SET flag. I
have tried and it does not seem to work. I could be doing something wrong
in
setting the Pt_ARG_FLAG resource but I think that side of it is working.

Is this the reason for the PtOnOffButton which can be easily set/reset.

Rod

CSIRO Minerals

This was a useful bit of information. It should be in
the help files for Pt_ARG_FLAG. Thanks.

John Nagle
Team Overbot

Rodney Stevens wrote:

all

It’s OK I was not setting the flag correctly. Learn something new every day.

Rod

“Rodney Stevens” <> rod.stevens@csiro.au> > wrote in message
news:c79344$d0i$> 1@inn.qnx.com> …

Dear all

Can a PtToggleButton be set and reset from code using the Pt_SET flag. I
have tried and it does not seem to work. I could be doing something wrong

in

setting the Pt_ARG_FLAG resource but I think that side of it is working.

Is this the reason for the PtOnOffButton which can be easily set/reset.

Rod

CSIRO Minerals


\

John Nagle <nagle@downside.com> wrote:

This was a useful bit of information. It should be in
the help files for Pt_ARG_FLAG. Thanks.

I’m not sure what you want us to add. Do you mean that we should say in
the docs for Pt_ARG_FLAG that the Pt_SET bit controls and indicates the
state of a PtToggleButton?

Here’s what the docs for Pt_ARG_FLAG currently say for Pt_SET:

Pt_SET
The widget is in a “set” state. Generally, this indicates that the
widget has been selected.

Here’s what the docs for PtToggleButton say:

To determine whether or not the button is set, check the:

  • Pt_SET bit in the Pt_ARG_FLAGS resource – see PtWidget
  • Callback data passed to the Pt_CB_ACTIVATE callbacks – see PtBasic

The docs for PtToggleButton should state (instead of just implying) that
you can use Pt_ARG_FLAGS to set or unset the toggle. Is that what you’d
like to see?


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems

It’s not obvious that for Pt_ARG_FLAGS, the “len”
argument to PtSetResource is a bitmask.
The help page for PtSetResource says “the way the fourth
argument is used depends on the resource type”. The
help page for Pt_ARG_FLAGS doesn’t mention the bitmask.
The only reference to the bitmask argument that I
could find was in a newsgroup posting.

This may deserve a mention somewhere in the help files.

John Nagle
Team Overbot

Steve Reid wrote:

John Nagle <> nagle@downside.com> > wrote:

This was a useful bit of information. It should be in
the help files for Pt_ARG_FLAG. Thanks.


I’m not sure what you want us to add.

I find this pice of the help docs useful for those questions:
file://localhost/L:/QNXsdk/target/qnx6/usr/help/product/photon/prog_guide/res_code.html
There is a section on each type of resource:
Alloc
Array
Boolean
Color
Complex
Flag
Function
Image
Link
Pointer
Scalar
String
Struct

On Wed, 02 Jun 2004 09:58:30 -0700, John Nagle <nagle@downside.com> wrote:

It’s not obvious that for Pt_ARG_FLAGS, the “len”
argument to PtSetResource is a bitmask. The help page for PtSetResource
says “the way the fourth
argument is used depends on the resource type”. The
help page for Pt_ARG_FLAGS doesn’t mention the bitmask.
The only reference to the bitmask argument that I
could find was in a newsgroup posting. This may deserve a mention
somewhere in the help files.


Using M2, Opera’s revolutionary e-mail client: http://www.opera.com/m2/

John Nagle <nagle@downside.com> wrote:

It’s not obvious that for Pt_ARG_FLAGS, the “len”
argument to PtSetResource is a bitmask.
The help page for PtSetResource says “the way the fourth
argument is used depends on the resource type”. The
help page for Pt_ARG_FLAGS doesn’t mention the bitmask.
The only reference to the bitmask argument that I
could find was in a newsgroup posting.

This may deserve a mention somewhere in the help files.

The sentence immediately after that is:

For information on getting and setting resources, see the Manipulating
Resources in Application Code chapter of the Photon Programmer’s Guide.

The link takes you right to the chapter that explains how to set the len
argument when setting and getting each type of resource. Repeating this
information for every resource in the Widget Reference would make it a
much bigger book than it is already!


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems

Steve Reid wrote:

The sentence immediately after that is:

For information on getting and setting resources, see the Manipulating
Resources in Application Code chapter of the Photon Programmer’s Guide.

OK. I’ve now found that information. I’m not familiar enough
with Photon’s object system yet.

The link takes you right to the chapter that explains how to set the len
argument when setting and getting each type of resource. Repeating this
information for every resource in the Widget Reference would make it a
much bigger book than it is already!

A hyperlink might be nice. But I take your point. Thanks.

John Nagle
Team Overbot

acellarius-thisNGisalsoharvested@forspamming.yahoodotcom wrote:
atfy > I find this pice of the help docs useful for those questions:
atfy > file://localhost/L:/QNXsdk/target/qnx6/usr/help/product/photon/prog_guide/res_code.html
atfy > There is a section on each type of resource:
atfy > Alloc
atfy > Array
atfy > Boolean
atfy > Color
atfy > Complex
atfy > Flag
atfy > Function
atfy > Image
atfy > Link
atfy > Pointer
atfy > Scalar
atfy > String
atfy > Struct

atfy > On Wed, 02 Jun 2004 09:58:30 -0700, John Nagle <nagle@downside.com> wrote:

This is a good page. I have it bookmarked. BUT . . .

It does not have an example of how to get and set each type of resource.