#include once "inc/wx.bi"

' NOTE:
' names of classes are with an underscrore in front
' constructors are reserved for an OOP frameword
' example: MyApp = wxApp_ctor() NOT MyApp = wxApp()
' strings and array of strings and array of integers are classes now

dim shared as _wxApp ptr App

function OnInit APICALL as wxBool
  ' create a wxFrame
  dim as _wxFrame ptr frame = wxFrame_ctor()
  wxFrame_Create(frame,WX_NULL,, wxString("first wxFrame"),,,,,wxFRAME_DEFAULT_STYLE)
  
  ' create a wxButton (normaly you have to create a wxSizer too)
  dim as _wxButton ptr button = wxButton_ctor()
  wxButton_Create(button, frame,, wxString("first wxButton"))
  
  wxWindow_Show(frame,WX_TRUE)
  
  return wxApp_OnInit(App)
end function  

function OnExit APICALL as wxInt
  return wxApp_OnExit(App)
end function

' create our wxApllication
App = wxApp_ctor()
' now it has 4 params i made the last two as optional 
wxApp_RegisterVirtual(App,@OnInit,@OnExit)
' thats all for now i must go sleeping
wxApp_Run()

