Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PB10 close the current window

Status
Not open for further replies.

avJ4

Technical User
Nov 22, 2011
5
NL
Hello,

I'm kinda new to PB.

What i want to do is:
Create a menu bar that i can put in the whole application.

Question:
In the menu bar is an option "exit" if exit is clicked i want to close the window.

Normally you would do this with: close(windowname).

How can I close a window without knowing the name?


Please let me know how I can do that.

Thanks in advance
 
Thanks Matt!

You really helped me out!
 
Hello,

Now I have the following problem:

I now have the menubar in the whole application, but I ran in to the following problem:

When running the application, everything runs smooth, except when clicking in the menubar on the same button on the page where you are at.

example:

-- open up the application --
click on the menubar: "customers"
click on the subitem: "new customer"

The page opens fine

there is only one problem:
when clicking again on "new customer" the application closes.

-- application exits --

what could I do to prevent the application from closing?

 
It's a Menu PBobject in PB10 called m_full

at: m_customers.m_new_customer clicked()
open(w_new_customer)
close(parentwindow)


so when you click m_customers.m_new_customer and you are at w_new_customer, it tries to open the w_new_customer but it's already open, but the close(parentwindow) is stil valid so it closes the application.


 
I dumped the code here:
The example I have given on the previous post was translated,

in the dumped code the name is m_leden.m_nieuw clicked
open(w_leden_nieuw)
close(parentwindow)

Sorry if i'm not explaining it clearly, my english is not to good, and i'm inexperienced with sybase/powerbuilder.
 
You could either:
Disable the open new customer window option on the menu if the window is already open (and enable it when you close it)
or
Check to see if the window is already open and bring it to the foreground if it is else open it.

Matt

"Nature forges everything on the anvil of time"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top