1. Berka Frenfert
  2. PowerBuilder
  3. Sunday, 23 April 2023 15:26 PM UTC

Activate event somehow makes an invisible window visible again while the Visible property of window remains false.

I can post event but i do not want to post event from Activate event because already posted many events and certain sequence is important.

What reason makes window visible in Activate and why even after setting it to false does not effect visibility?

How to fix this issue?

 

I opened a window and in open event posted _hide() and in that event i set window visible property to false and called Hide() function too but window remains visible.

what to do to hide a window  already opened or what to do to hide window even before open event is fired?

 

Regards,

Berka

Accepted Answer
Berka Frenfert Accepted Answer Pending Moderation
  1. Tuesday, 25 April 2023 22:49 PM UTC
  2. PowerBuilder
  3. # Permalink

PB help says:

You cannot use the Visible property or the Show or Hide functions to show or hide an MDI sheet or a drop-down or cascading menu or any menu that has an MDI frame window as its parent window.

I opened sheet in MDI frame that is why visible = false had no effect.

Comment
  1. Benjamin Gaesslein
  2. Wednesday, 26 April 2023 12:05 PM UTC
You can set the window type in the painter and save the window. It can be opened with OpenSheet just like a regular window with the difference that resizing it to zero will also hide the titlebar.



Define creating at runtime, please. How are you doing this and why would you need to import this window back into a library? Is this a window that you create just for this purpose or a regular window you just want to make invisible in some cases? What are you using this invisible window for? This might be a XY problem where the solution you ask about might not be viable for the problem at hand.
  1. Helpful
  1. Berka Frenfert
  2. Wednesday, 26 April 2023 12:38 PM UTC
Ok i will explain, the app i am working on has more than 500 windows and all of them except for rows search windows (response windows) are main windows. Main windows are opened from menu as MDI sheets. This is the most common way everybody handle windows.



Now, thing to note is that i am writing code in the parent window that has no parent. That also means all my sheets are inherited from the lets say w_parent.

2nd important thing is that i dont want to open every inherited sheet and manually change its type in design mode to something other than Main.



Now, last option to change type at runtime is to do LibraryExport/Import and when syntax is in variable i change type and then Import the window back into a temp library. This will not happen in PB because LibraryImport function takes only DataWindow! as parameter. Window or any other object cannot be imported into Library.



Certainly changing type of window seems too much of work to me. I would do one thing next and that is the reason to find why TypeOf() always fail when height/width of sheet is not bigger enough like 600 or more.



HTH

  1. Helpful
  1. Berka Frenfert
  2. Wednesday, 26 April 2023 12:48 PM UTC
May be CREATE is alternate way to change type of a window but side effects are too many if i do it.

Alright, just checked it and PB help says

"To create an instance of a visual user object or window, use the appropriate Open function (instead of CREATE)."



  1. Helpful
There are no comments made yet.
Mark Goldsmith Accepted Answer Pending Moderation
  1. Wednesday, 26 April 2023 02:41 AM UTC
  2. PowerBuilder
  3. # 1

Hi Berka,

You could simulate the same thing by positioning the window way off screen, something like w_mywindow.X = -3000. However, keep in mind that if you have code that re-positions your windows, for example ParentWindow.Arrangesheets(), it will bring the window back into view. To get around that you would have to check for any that are "hidden" and reissue the w_mywindow.X setting for those windows.

HTH...regards,

Mark

Comment
  1. Berka Frenfert
  2. Wednesday, 26 April 2023 09:36 AM UTC
Hi Mark,

That is sure pretty good idea in case nothing else works. I can tell you another issue with this idea is that when for example I set width = 1; Height =1 and try to get type of any object in the control array of the window the typeof() returns nothing. And yes without any other change in code i just set greater height and width like height=600; width=300; then typeof() function starts working. Too annoying it is in fact.



True Regards,

Berka

  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Sunday, 23 April 2023 17:33 PM UTC
  2. PowerBuilder
  3. # 2

Hi Berka;

   PB runtime would never do that. It must be in your App's code somewhere. Check all your related posted events and your all your control's & window ancestor's code.

   Are using the PFC Framework?

Regards ... Chris 

Comment
  1. Berka Frenfert
  2. Sunday, 23 April 2023 22:20 PM UTC
Is it the messageBox in Activate making problem?
  1. Helpful
  1. Chris Pollach @Appeon
  2. Sunday, 23 April 2023 22:37 PM UTC
Hi Berka;

OMG... PB 12.5!

If that was a bug (I can't remember seeing that when I used v12.x), it was probably fixed by Sybase in versions 12.5.1 or 12.5.2 MR's.

Also, it could be a side effect of running this old outdated release on W10 or W11 as 12.5 was never certified for newer MS-Windows O/S releases.

Regards ... Chris
  1. Helpful
  1. Berka Frenfert
  2. Monday, 24 April 2023 00:24 AM UTC
Hi Chris,

Thanks a lot for another response. May be win 8.1 is not compatible with PB 12.5 :)

I found alternate way to get rid of this problem, I removed my script from Activate and somehow it worked for me.

You are right older PB version always hit harder in terms of support and bugs. I got used to of it though.

True regards,

Berka
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.