I have small about box with an image.
When this window is displayed it looks good; but if I click on the main app window, the about box looses focus; if I go back to the window -- the image is gone.
There is no code manipulating the image gadget.
why would the image disappear? the image is loaded from w/in the exe.
Is there a way to make the window modal? ie: the main screen cannot be acted upon, and the about box remains on top?
( I want to maintain os compatibility, so a "pure" purebasic solution is preferred over winapi's)
"about box" image disappears. How to make modal?
Re: "about box" image disappears. How to make modal?
Just a guess, but check the ImageID. If you use the same ID in another window, they'll "steal" the image from one another.
Re: "about box" image disappears. How to make modal?
It's the only image...TomS wrote:Just a guess, but check the ImageID. If you use the same ID in another window, they'll "steal" the image from one another.
I had an imagebutton -- but the image would either show up incorrectly or not at all when disabled..
Re: "about box" image disappears. How to make modal?
jassing wrote:Is there a way to make the window modal? ie: the main screen cannot be acted upon, and the about box remains on top?
( I want to maintain os compatibility, so a "pure" purebasic solution is preferred over winapi's)
Code: Select all
OpenWindow(0, #PB_Ignore, #PB_Ignore, 800, 600, "")
CreateMenu(0, WindowID(0))
MenuTitle("?")
MenuItem(0, "About")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Select EventWindow()
Case 0
Break
Case 1
DisableWindow(0, #False)
CloseWindow(1)
EndSelect
Case #PB_Event_Menu
Select EventMenu()
Case 0
OpenWindow(1, 0, 0, 400, 300, "About", #PB_Window_SystemMenu | #PB_Window_WindowCentered, WindowID(0))
DisableWindow(0, #True)
EndSelect
EndSelect
ForEver
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Re: "about box" image disappears. How to make modal?
ts-soft postet the solution to your question, but if you only want a modal window, because of the image disappearing, post some code and maybe we can help.
Re: "about box" image disappears. How to make modal?
This is not supposed to happen. If you can reproduce this in a small snippet, post it here and we will help you. If you can't, you know for sure that the problem is somewhere in your big program.
Either you're reusing the same gadget number on different windows, or you have miscoded your event handling (maybe you made more than one event loop?).
Either you're reusing the same gadget number on different windows, or you have miscoded your event handling (maybe you made more than one event loop?).