IGlass GUI for blitzmax - V

BlitzMax Forums/BlitzMax Programming/IGlass GUI for blitzmax - V

Like this?
' ==================================================================
' Project Title: IGlass template example
' Author: Agnisola Philippe (Filax)
' Email: blitz3d.fr@...                   
' Version: 1.0.0           
' Date: 10/03/2005             
' Notes:             
'                   
'                   
' ==================================================================

Strict

' --------------------------
' Load IGL gui ! important !
' --------------------------
Include "./IGL_Classe/Inc_IGlass.bmx"

' ------------
' Open graphic
' ------------
Graphics 800,600,32,NOSYNC 

' --------------------------
' Init IGL gui ! important !
' --------------------------
IGL_InitGUI(1)

'IGL_InitBackground("../IGL_Demos/Background_01.jpg")
'IGL_InitBackground("../tg/skyatnightold_800_600.png")

' ---------------
' Build interface
' ---------------
Global MyWindow01:IGL_Window
Global MyWindow02:IGL_Window

MyWindow01=IGL_Window.Create("TG_Window1",50,50,180,150)

Local MyButton0:IGL_PushButton
MyButton0=IGL_PushButton.Create(MyWindow01,"ByeBye",10,10,160)
Local mybutton1:IGL_Pushbutton
' -------------
' The main loop
' -------------
While Not KeyHit(KEY_ESCAPE)
	Cls
	
	' -----------------------------
	' Refresh IGL gui ! important !
	' -----------------------------
	IGL_RefreshGui()

	' --------
	' Gui test
	' --------
    If MyWindow02<>Null MyWindow02.activatewindow()
	If MyButton0.ClickGadget() And mywindow02=Null Then
		MyWindow02=IGL_Window.Create("TG_Window2",150,150,180,150)
        MyButton1=IGL_PushButton.Create(MyWindow02,"Really?",10,10,160)
        MyWindow02.activatewindow()
	EndIf
	If MyButton1<>Null
		If MyButton1.ClickGadget() Then
           Exit
        EndIf
    EndIf	
	' -------------------------------
	' Draw FPS info (use IGL_Fps var)
	' -------------------------------
	SetColor 255,255,255
	DrawText "FPS : "+IGL_Fps,10,10
	
	' ------------------------
	' Swap buffer and flushmem
	' ------------------------
	Flip
	FlushMem()
Wend 

' ---------------------------
' Clear IGL gui ! important !
' ---------------------------
IGL_ClearGui()
End


Still doesn't focus on MyWindow02.
<edit> I'm assuming you have tried this and it works which is very strange. How are you using ActivateWindow different than me? Can you post your code which has this working?