Re: he conseguido un iphone
Posted: Fri Oct 22, 2010 12:40 am
Antonio
si me lo imagino, pero todo sea por aportar
si me lo imagino, pero todo sea por aportar
www.FiveTechSoft.com
https://fivetechsupport.com/forums/
https://fivetechsupport.com/forums/viewtopic.php?f=8&t=20079
#import <UIKit/UIKit.h>
#define HB_DONT_DEFINE_BOOL
#include <hbapi.h>
void SetWndMain( UIWindow * window );
HB_FUNC( CREATEWINDOW )
{
UIWindow * window = [ UIWindow alloc ];
// float color[ 4 ] = { 0, 0, 0.63, 1 }; // R, G, B, Alpha
// [ window setView : [ [ UIView alloc ] initWithFrame : [ window bounds ] ] ];
[ window setBackgroundColor: [ UIColor greenColor ] ];
hb_retnl( ( LONG ) window );
}
HB_FUNC( WNDACTIVATE )
{
UIWindow * window = ( UIWindow * ) hb_parnl( 1 );
SetWndMain( window );
// [ window orderFront : nil ];
[ window makeKeyAndVisible ];
}
HB_FUNC( WNDCLOSE )
{
UIWindow * window = ( UIWindow * ) hb_parnl( 1 );
[ window release ];
}
./lib/libfivec.a : ./objc/mainapp.o ./objc/uikit.o ./objc/msgs.o ./objc/windows.o
$(LM) -static -o ./lib/libfivec.a ./objc/mainapp.o ./objc/uikit.o ./objc/msgs.o ./objc/windows.o
function Main()
local oWnd := TWindow():New()
oWnd:Activate()
MsgInfo( "Hello world!" )
return nil
void MsgInfo( NSString * );
@interface Window : UIWindow
{
}
- ( void ) touchesBegan : ( NSSet * ) touches withEvent : ( UIEvent * ) event;
@end
@implementation Window
- ( void ) touchesBegan : ( NSSet * ) touches withEvent : ( UIEvent * ) event
{
MsgInfo( @"touch!" );
}
@end
HB_FUNC( CREATEWINDOW )
{
Window * window = [ [ Window alloc ] initWithFrame : [ [ UIScreen mainScreen ] bounds ] ];
window.backgroundColor = [ UIColor greenColor ];
hb_retnl( ( LONG ) window );
}
void MsgInfo( NSString * text )
{
UIAlertView * alert = [ [ UIAlertView alloc ] initWithTitle : @"Information"
message : text delegate : GetApp()
cancelButtonTitle : @"OK" otherButtonTitles : nil ];
[ alert show ];
[ alert autorelease ];
}