I have a window, which is a child of the main application. In a simple test, it works fine.
In a more complicated project, it "disappears". I see it for a split second, then it goes and never returns. I have tried to SHOW WINDOW every cycle as a safety net, to no avail.
In the simple version, I added CLS to the loop. This doesn't kill it, it's quite happy.
The main project is 9000+ lines, so tracking it down could be a problem. Any ideas on what could be causing this? Simple example in box below
set window title "myapp"
setup gui "myapp", "xxxx"
global ToolWindow as integer
global ToolWindowWidth as integer
global ToolWindowHeight as integer
global ToolTab as integer
global ToolTabWidth as integer
global ToolTabHeight as integer
global ToolTabCount as integer
global ToolTabLast as integer
global ToolPanel as integer
global ToolPanelWidth as integer
global ToolPanelHeight as integer
global ToolMin as integer
global PanelFilter as integer
global PanelObject as integer
global PanelLight as integer
global PanelMatrix as integer
ToolWindow = 200
ToolWindowWidth = 220
ToolWindowHeight = 200
ToolMin = ToolWindow + 1
ToolTab = ToolWindow + 2
ToolTabWidth = ToolWindowWidth - 4
ToolTabHeight = ToolWindowHeight - 4 - 20 : ` Subtract Minimize Button height
ToolPanel = ToolTab + 10
ToolPanelCount = 4
ToolPanelWidth = ToolTabWidth - 4
ToolPanelHeight = ToolTabWidth - 4
PanelFilter = ToolPanel : ` Allow for up to 100 Gadgets for objects
PanelObject = ToolPanel + 100 : ` Allow for up to 100 gadgets for objects
PanelLight = ToolPanel + 100
PanelMatrix = ToolPanel + 10
createToolKit()
do
checktoolkit()
loop
function createToolKit()
create hidden
` Toolkit Window - resizable tool window, childof main
create gadget window ToolWindow,2,"Toolkit",1
set gadget ToolWindow,3,3,ToolWindowWidth,ToolWindowHeight
create with parent ToolWindow
create gadget button ToolMin, "Minimise"
set Gadget ToolMin,0,0,50,20
create gadget tabs ToolTab
set gadget ToolTab,2,21,ToolTabWidth,ToolTabHeight
Add tab ToolTab,"Filters"
add tab ToolTab, "Objects"
add tab ToolTab, "Lights"
add tab ToolTab, "Matrices"
create with parent ToolTab
` Set up Filters Panel
create gadget panel PanelFilter,0
set gadget panelFilter,2,21,ToolPanelWidth - 4,ToolPanelHeight - 4
` Add Filter Drop-down
create with parent PanelFilter
create gadget combobox PanelFilter + 1
SET gadget PanelFilter + 1, 2,1, ToolPanelWidth - 4, 20
add item PanelFilter + 1, "Matrices"
add item PanelFilter + 1, "Objects"
add item PanelFilter + 1, "Lights"
` Set up Objects panel
create gadget panel PanelObject,0
set gadget panelObject,2,21,ToolPanelWidth - 4,ToolPanelHeight - 4
` Set up Lights panel
create gadget panel PanelLight,0
set gadget panelLight,2,21,ToolPanelWidth - 4,ToolPanelHeight - 4
` Set up Matrices panel
create gadget panel PanelMatrix,0
set gadget panelMatrix,2,21,ToolPanelWidth - 4,ToolPanelHeight - 4
show all gadgets
endfunction
function CheckToolKit()
`Check Window is visible/enabled
window = gadget visible(ToolWindow)
if window = 0
show gadget ToolWindow
endif
`Check which tab is active
tab = active tab(ToolTab)
CheckTab(tab)
` Tab 0 - Filters
If tab = 0
` Check which filter subset in use
endif
` Tab 1 - Objects
if tab = 1
endif
` Tab 2 - Lights
if tab = 2
endif
` Tab 3 - Matrices
if tab = 3
endif
endfunction
function checkTab(tab)
if tab <> ToolTabLast
hide Gadget PanelFilter
hide Gadget PanelObject
hide Gadget PanelLight
hide Gadget PanelMatrix
select tab
case 0
show Gadget PanelFilter
endcase
case 1
show Gadget PanelObject
endcase
case 2
show Gadget PanelLight
endcase
case 3
show Gadget PanelMatrix
endcase
endselect
ToolTabLast = tab
endif
endfunction
BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply