window minimizes after inputrequester

Just starting out? Need help? Post your questions and find answers here.
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

window minimizes after inputrequester

Post by localmotion34 »

after i call the inputrequester to get a string from user entry, and the "ok" button is clicked, my main window is either minimized or sent to the background automatically. and there is nothing i can do to stop it. i tried the API to minimize, maximize, and top-level a window, but it seems after the input requester, manual input is required to bring the main window to the top again.

Code: Select all

date$=FormatDate("%mm/%dd/%yy", Date())  
          workoutdate$=InputRequester("Enter The Date For The Workout","",date$)

if workoutdate$<>""
else
endif 
thats the basic code when the requester is called. any ideas?

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: window minimizes after inputrequester

Post by PB »

> it seems after the input requester, manual input is required to bring the
> main window to the top again.

This works fine for me (W2K Pro) and doesn't affect my window in any way.
If it also works for you, then clearly something else is at fault (either your
code or OS environment, or perhaps a combination of both).

Code: Select all

If OpenWindow(1,300,250,400,200,#PB_Window_SystemMenu,"Window")
  CreateGadgetList(WindowID())
  ButtonGadget(1,50,50,60,25,"test")
  Repeat
    ev=WaitWindowEvent()
    If ev=#PB_Event_Gadget
      a$=InputRequester("title","message","default")
    EndIf
  Until ev=#PB_EventCloseWindow
EndIf
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Post by Paul »

There is a z-order problem with PB windows and Fred is aware of the problem. This IS a bug and Fred has told me he is working on trying to fix it. (I hope there is a fix in the near future)
Image Image
Dr_Pixel
User
User
Posts: 36
Joined: Fri Oct 24, 2003 1:36 pm

Post by Dr_Pixel »

I've had somewhat similar problems a couple of times, but in my case it has been the PathRequester appearing in back of my program's window(s)

In these cases, clicking on my program's window would give the "error" sound, and pop the PathRequester to the front where it should have been.

Is this related to the same bug?

I've managed to correct them by making changes in my code, doing whatever operation came before the PathRequester in a different way -

but there was really nothing wrong with the original code that I could find.
Dr Pixel
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Post by localmotion34 »

well this z order problem has created an "f" order problem, namely the order in which a certain word that starts with that letter is yelled by me every other word when i try to fix this. anyone else have an idea?

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

Localmotion, to bring your window back to the front after using the requester
just call SetForegroundWindow_(WindowID()) and it should do it. Also, did my
example above work properly for you? I'm curious as I've never had this bug
with PureBasic at all.
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

..

Post by NoahPhense »

PB wrote:Localmotion, to bring your window back to the front after using the requester
just call SetForegroundWindow_(WindowID()) and it should do it. Also, did my
example above work properly for you? I'm curious as I've never had this bug
with PureBasic at all.
Your above code works fine for me.. specs below (win2k)

- np
Post Reply