Grouping custom widgets?

Is there a way to create a custom widget that is comprised of two other custom widgets? I need a way to ensure that a user cannot use these widgets separately and can only be placed on the screen as a group.

The reason I can’t just make one widget is that the end widget will comprise of two separate buttons. Is there a way to make two selectable areas within one widget?

Plant them on a pane or really create a custom widget with “Building Custom Widgets”-chapter, which allows you to block special resources

When a button is pressed, your callback can check the mouse pointer location and therefore can distinguish between one side of the button or the other. In this way you can make two selectable areas. There are some visual issues to this approach. For example, regardless where you pressed, the entire button would flex.

I’m not really sure what you mean by ensuring that the user cannot use the widgets separately. Is the user an end user or a programmer?

By user i mean another programmer who is going to create screens. The end widget will look like two separate buttons. Since the two buttons will never be used individually I want to group them together so they cannot be placed on the screen alone.

I essentially want to create a custom widget that consists of two other custom widgets.

You can do that…

I know I’m not helping too much but you can be sure here (somewhere) is what you need:

qnx.com/developers/docs/qnx_ … about.html

JM

Or here:

qnx.com/developers/docs/6.3. … about.html

JM

I don’t want to seem judgmental but creating a custom widget to enforce control over a programmer seems a little bit extreme. You could (much more easily) use PhAB to create the structure you want and put it in a database. Even that seems a little bit stressed. If you can’t count on a programmer putting both buttons on together (by asking them to), then what can you count on them doing?

producing bugs ^^

I’m creating different custom widgets to represent different physical components throughout a plant.

Each widget is to display several attributes about each piece of hardware in real time, I don’t think using PtButtons would be the way to go.

I’m creating different custom widgets to represent different physical components throughout a plant.

Each widget is to display several attributes about each piece of hardware in real time, I don’t think using PtButtons would be the way to go.

Lol, yes they will, but they will do that no matter what you do. That is part of their job. Of course finding and removing is also.

Producing bugs is not part of my job.

As a contactor I often remind my employer “I don’t charge for bugs, those are free”. When they reply “really?”. I say “Yup. But I do charge to fix them”. :slight_smile:

Tim

Creating bugs has always been part of the job. It’s just not a required part. Removing them is required. When you figure out a way to write software that doesn’t have any bugs, please let us all know. :slight_smile:.