creating a window

I have to create a managed window without using the PtWidget widget.
To do so I use the PhRegionOpen and set the region flags to
Ph_WINDOW_REGION and Ph_WND_MGR_REGION but It dosn’t seem to work

Could someone provide a little code snippet?

Another thing: how to manage the window state qhen creating a window
in this way?

Thanks

Hello wavexx@broadcast.anarchy.net

Could you provide a little more information as to what you are trying to do?
The PtRegion widget also contains a reference to the PtWidget widget. Is
that a typo there? Is it that you are trying to create a managed
window without using the PtWindow widget?

Thanks
Rodney


wavexx@broadcast.anarchy.net wrote:

I have to create a managed window without using the PtWidget widget.
To do so I use the PhRegionOpen and set the region flags to
Ph_WINDOW_REGION and Ph_WND_MGR_REGION but It dosn’t seem to work

Could someone provide a little code snippet?

Another thing: how to manage the window state qhen creating a window
in this way?

Thanks

Gui Group <gui@qnx.com> wrote:

Hello > wavexx@broadcast.anarchy.net

Could you provide a little more information as to what you are trying to do?
The PtRegion widget also contains a reference to the PtWidget widget. Is
that a typo there? Is it that you are trying to create a managed
window without using the PtWindow widget?

I’m trying to create a window using directly the photon library. I
don’t want to use Window widgets of any sort. I want to create a
region manually and manipulate that region to become a window.

In pseudo code terms I must do something like:

rid = PhRegionOpen(some flags here);
(rid is now a managed window, with a titlebar and so on)
change_caption(rid, “this is a window”);

Is this possible to do without using PtWidgetCreate(PtWindow…)?


Wave++

Hello Wave++

Yes it is possible but it is extremely difficult. What you want to do is look at the
PhWindowOpen call and read up on the related links. You will also want to make sure that
you read up on the Photon Events, because you are going to have to manage your own event
loop. When you do things this way you will not be able use any of the Pt* calls. This
is because you can’t use the mainloop for what you are trying to do. If you are doing
this just to play around then trying this out isn’t that bad of an idea but a couple of
the developers here have said that they wouldn’t recommend doing a shipped product this
way because of the reasons above and also because it would not be forward compatible
with Photon 2.0 if you ever wanted to move the product to that system.

Thanks
Rodney

Wave++ <wavexx@apexmail.com> wrote:

Gui Group <> gui@qnx.com> > wrote:
Hello > wavexx@broadcast.anarchy.net

Could you provide a little more information as to what you are trying to do?
The PtRegion widget also contains a reference to the PtWidget widget. Is
that a typo there? Is it that you are trying to create a managed
window without using the PtWindow widget?

I’m trying to create a window using directly the photon library. I
don’t want to use Window widgets of any sort. I want to create a
region manually and manipulate that region to become a window.

In pseudo code terms I must do something like:

rid = PhRegionOpen(some flags here);
(rid is now a managed window, with a titlebar and so on)
change_caption(rid, “this is a window”);

Is this possible to do without using PtWidgetCreate(PtWindow…)?


Wave++

Gui Group <gui@qnx.com> wrote:

Hello Wave++

PhWindowOpen call and read up on the related links. You will also want to make sure that
you read up on the Photon Events, because you are going to have to manage your own event

Does qnx rtos 6.1 use photon 2? I’ve not found PhWindowOpen in the
help system.

However, my application has already his own loop management for some
regions, so creating a window in this way would be “easyer” :slight_smile:

The other way to create a window would be PtCreateWidget(PtWindow but
during the execution I’ll never call the PtMainLoop since my
application already has his own loop manager. Also, I need to use the
region inside that window for drawing directly.


Wave++

Wave++ <wavexx@apexmail.com> wrote:

Gui Group <> gui@qnx.com> > wrote:
Hello Wave++

PhWindowOpen call and read up on the related links. You will also want to make sure that
you read up on the Photon Events, because you are going to have to manage your own event

Does qnx rtos 6.1 use photon 2? I’ve not found PhWindowOpen in the
help system.

Yes. Sorry I thought that you were using QNX 4.25 and Photon 1.1x. I must have been
reading another posting and gotten confused when I posted to this one. Sorry there isn’t
that kind of call in Photon 2.0. Did you try the code example that was given with the
PhRegionOpen? Can you send me a sample of what you tried to do in order to get it to
behave like a window?

Thanks
Rodney


Wave++

Gui Group <gui@qnx.com> wrote:

Wave++ <> wavexx@apexmail.com> > wrote:
Gui Group <> gui@qnx.com> > wrote:
Yes. Sorry I thought that you were using QNX 4.25 and Photon 1.1x. I must have been
reading another posting and gotten confused when I posted to this one. Sorry there isn’t
that kind of call in Photon 2.0. Did you try the code example that was given with the
PhRegionOpen? Can you send me a sample of what you tried to do in order to get it to
behave like a window?

I’ve watched the header files and I’ve found the PhWindowOpen call. It’s
declared in
photon/PhProto.h . I’ve also found the documentation on the qdn site
(It’s for photon 1.1x but the prototype is the same:
http://qdn.qnx.com/support/docs/photon114/lib_ref/ph/phwindowopen.html).

Can I still use it or this function remains only for backward
compatibility?

However I switched my code to use a PtWindow widget but I still have
the need of controlling the region. Is there a way to extract a
PtRegion from a newly created window or I must get the rid
(PtWidgetRid…) manually and modify the region using PhRegionChange?
In this case, It’s better to use PhWindowOpen and creating a region
exactly as I want instead of creating a default one and than doing
the extract thing. So why removing the PhWindowOpen for photon2?


Wave++

Wave++ <wavexx@apexmail.com> wrote:

Gui Group <> gui@qnx.com> > wrote:
Wave++ <> wavexx@apexmail.com> > wrote:
Gui Group <> gui@qnx.com> > wrote:
Yes. Sorry I thought that you were using QNX 4.25 and Photon 1.1x. I must have been
reading another posting and gotten confused when I posted to this one. Sorry there isn’t
that kind of call in Photon 2.0. Did you try the code example that was given with the
PhRegionOpen? Can you send me a sample of what you tried to do in order to get it to
behave like a window?

I’ve watched the header files and I’ve found the PhWindowOpen call. It’s
declared in
photon/PhProto.h . I’ve also found the documentation on the qdn site
(It’s for photon 1.1x but the prototype is the same:
http://qdn.qnx.com/support/docs/photon114/lib_ref/ph/phwindowopen.html> ).

Can I still use it or this function remains only for backward
compatibility?

However I switched my code to use a PtWindow widget but I still have
the need of controlling the region. Is there a way to extract a
PtRegion from a newly created window or I must get the rid
(PtWidgetRid…) manually and modify the region using PhRegionChange?
In this case, It’s better to use PhWindowOpen and creating a region
exactly as I want instead of creating a default one and than doing
the extract thing. So why removing the PhWindowOpen for photon2?

You can use the the PhWindowOpen calls in Photon 2.0. They weren’t put
in the docs because we are probably going to make chagnes to the calls for
a future release. Using PhWindowOpwn is going to create a window frame for
the region that it creates, so if you want to make changes to it then you are
going to have to call PhRegionChange anyways. Because of this the PtWindow way
is probalby easier. I should have asked you this earlier, but what is it that you
are trying to accomplsih in general?

Rodney


Wave++

Gui Group <gui@qnx.com> wrote:

Wave++ <> wavexx@apexmail.com> > wrote:
Gui Group <> gui@qnx.com> > wrote:
In this case, It’s better to use PhWindowOpen and creating a region
exactly as I want instead of creating a default one and than doing
the extract thing. So why removing the PhWindowOpen for photon2?

You can use the the PhWindowOpen calls in Photon 2.0. They weren’t put
in the docs because we are probably going to make chagnes to the calls for
a future release. Using PhWindowOpwn is going to create a window frame for
the region that it creates, so if you want to make changes to it then you are
going to have to call PhRegionChange anyways. Because of this the PtWindow way
is probalby easier. I should have asked you this earlier, but what is it that you
are trying to accomplsih in general?

I’m trying to draw directly on a window, without using Pt* widgets since the
draw probably will not need to be refreshed on damages, resized and so on.
Generally I’m trying to master the underlines of photon :slight_smile:. No particular
application involved.
I’ve worked for years using X11 and now I’ve found photon really intresting
and >easy< (if you know X11, you know it, it’s damn complicated :slight_smile:).

You haven’t tell me if is it possible to extract a PtRegion from a PtWindow.
I’ve tryed to parse the widget hierarchy at runtime and found anything but a
PtWindow widget. I think I must manipulate the region directly right?


Wave++

Wave++ <wavexx@apexmail.com> wrote:

Gui Group <> gui@qnx.com> > wrote:
Wave++ <> wavexx@apexmail.com> > wrote:
Gui Group <> gui@qnx.com> > wrote:
In this case, It’s better to use PhWindowOpen and creating a region
exactly as I want instead of creating a default one and than doing
the extract thing. So why removing the PhWindowOpen for photon2?

You can use the the PhWindowOpen calls in Photon 2.0. They weren’t put
in the docs because we are probably going to make chagnes to the calls for
a future release. Using PhWindowOpwn is going to create a window frame for
the region that it creates, so if you want to make changes to it then you are
going to have to call PhRegionChange anyways. Because of this the PtWindow way
is probalby easier. I should have asked you this earlier, but what is it that you
are trying to accomplsih in general?

I’m trying to draw directly on a window, without using Pt* widgets since the
draw probably will not need to be refreshed on damages, resized and so on.
Generally I’m trying to master the underlines of photon > :slight_smile:> . No particular
application involved.
I’ve worked for years using X11 and now I’ve found photon really intresting
and >easy< (if you know X11, you know it, it’s damn complicated > :slight_smile:> ).

You haven’t tell me if is it possible to extract a PtRegion from a PtWindow.
I’ve tryed to parse the widget hierarchy at runtime and found anything but a
PtWindow widget. I think I must manipulate the region directly right?

No actually you don’t have to manipulate the region directly. All you have to
do is get the RID of the window ( using PtWidgetRid, which you mentioned before) and
then you just call PgSetRegion. This will allow you to draw on the window.

Rodney



Wave++