Created
November 30, 2013 09:35
-
-
Save chrisnharvey/7717051 to your computer and use it in GitHub Desktop.
wxphp XRC demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class myApp extends wxApp | |
{ | |
function pushBut() | |
{ | |
exit('sdfsdf'); | |
} | |
function OnInit() | |
{ | |
global $mf; | |
$xrc = new wxXmlResource(); | |
wxXmlResource::Get()->InitAllHandlers(); | |
wxXmlResource::Get()->Load('test.xrc'); | |
$dialog = new wxFrame(); | |
wxXmlResource::Get()->LoadFrame($dialog, null, 'MyFrame1'); | |
$id = wxXmlResource::Get()->GetXRCID('m_button1'); | |
$dialog->Connect($id, wxEVT_COMMAND_BUTTON_CLICKED, array($this, 'pushBut')); | |
$dialog->Show(); | |
// $view = View::load('mainView'); | |
// $view->get('MyFrame1')->show(); | |
// $view->find('button')->listen('clicked', function() { | |
// exit('do ma shit'); | |
// }); | |
// $mf = $xrc->LoadFrame('MyFrame1', null, null); | |
//$res = $xrc->GetResourceNode('MyFrame1'); | |
//$handle = new wxXmlResourceHandler; | |
//$source = $handle->CreateResource($res, null, null); | |
// $source->Show(); | |
// var_dump($mf); exit; | |
// $mf->Show(); | |
// | |
return 0; | |
} | |
function OnExit() | |
{ | |
return 0; | |
} | |
} | |
$xt = new myApp(); | |
wxApp::SetInstance($xt); | |
wxEntry(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment