Results 1 to 2 of 2
Discuss [PyObjC] import at the iPhone Developer Exchange - Hackint0sh.org; Hello all i just started using saurik's PyObjC for developing iPhone applications with python. simple ...
  1. #1
    Newbie Array

    Join Date
    Apr 2008
    Posts
    1
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default [PyObjC] import

    Hello all

    i just started using saurik's PyObjC for developing iPhone applications with python. simple layout and interaction are working great. it only took some minutes to create an application.

    But registering finger positions seems not to work due to a problem with GraphicsServices. The function GSEventGetLocationInWindow is not known by python.

    Is it right that GSEventGetLocationInWindow is part of the GraphicsServices.framework?
    I already loaded it via
    Code:
    GraphicsServices = objc.lookUpClass('GraphicsServices')
    but an import like this does not work
    Code:
    objc.loadBundle("GraphicsServices", globals(), "/System/Library/Frameworks/GraphicsServices.framework")
    Is there anyone with experience in PyObjC and / or iPhone development who can give me a hint whats wrong in my application?

    Any help is appreceated.

    Greetings

    em05




    Code:
    import objc
    from _uicaboodle import * #UIApplicationMain, CoreFoundation
    from objc import YES, NO, NULL
    
    objc.loadBundle("Celestial", globals(), "/System/Library/Frameworks/Celestial.framework")
    objc.loadBundle("UIKit", globals(), "/System/Library/Frameworks/UIKit.framework")
    objc.loadBundle("CoreGraphics", globals(), "/System/Library/Frameworks/CoreGraphics.framework")
    objc.loadBundle("CoreFoundation", globals(), "/System/Library/Frameworks/CoreFoundation.framework")
    objc.loadBundle("Foundation", globals(), "/System/Library/Frameworks/Foundation.framework")
    objc.loadBundle("GraphicsServices", globals(), "/System/Library/Frameworks/GraphicsServices.framework")
    
    UIApplication = objc.lookUpClass('UIApplication')
    UITable = objc.lookUpClass('UITable')
    UIWindow = objc.lookUpClass('UIWindow')
    UIHardware = objc.lookUpClass('UIHardware')
    UISectionList = objc.lookUpClass('UISectionList')
    UIView = objc.lookUpClass('UIView')
    GraphicsServices = objc.lookUpClass('GraphicsServices')
    
    class PYApplication(UIApplication):
    
        #@objc.signature("v@:@")
        def applicationDidFinishLaunching_(self, unused):
            self.contacts_ = []
            self.sections_ = []
    
            outer = UIHardware.fullScreenApplicationContentRect()
            self.window = UIWindow.alloc().initWithFrame_(outer)
    
            self.window.orderFront_(self)
            self.window.makeKey_(self)
            self.window._setHidden_(NO)
    
            inner = self.window.bounds()
            navsize = UINavigationBar.defaultSize()
            navrect = ((0, 0), (inner[1][0], navsize[1]))
    
            self.view = UIView.alloc().initWithFrame_(self.window.bounds())
            self.window.setContentView_(self.view)
    
            self.navbar = UINavigationBar.alloc().initWithFrame_(navrect);
            self.view.addSubview_(self.navbar)
    
            self.navbar.setBarStyle_(1)
    
            navitem = UINavigationItem.alloc().initWithTitle_("PyTouchSocket")
            self.navbar.pushNavigationItem_(navitem)
            
            lower = ((0, navsize[1]), (inner[1][0], navsize[1]+50))
            self.text = UITextView.alloc().initWithFrame_(lower)
            self.view.addSubview_(self.text)
            self.text.setEditable_(NO)
            self.text.setText_("no input yet..")
            
    	#@objc.signature("@")
        def mouseDown_(self, event):
    		point = GSEventGetLocationInWindow(event)
    		self.text.setText_(tuple(event))
    		
    
    UIApplicationMain(["HelloPython"], PYApplication)
    Last edited by em05; 04-28-2008 at 08:54 PM.



  2. #2
    Rookie Array

    Join Date
    Nov 2007
    Posts
    28
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Bump!

    Anyone with this required info? Also anyone using python to do any serious application development?

 

 

Similar Threads

  1. Cant import sim contacts
    By kingroach in forum General
    Replies: 0
    Last Post: 11-20-2008, 01:24 AM
  2. UK iphone import
    By matthewrotherham in forum General
    Replies: 4
    Last Post: 02-19-2008, 03:06 PM
  3. Import mp3
    By Paralias in forum iPhone "2G" (Rev. 1)
    Replies: 9
    Last Post: 12-06-2007, 07:22 AM
  4. To import or not to import, that is the question...
    By DecksTerrorT in forum iPhone "2G" (Rev. 1)
    Replies: 0
    Last Post: 11-20-2007, 02:29 PM
  5. How do you import photos to your PC ?
    By wigo in forum General
    Replies: 3
    Last Post: 10-23-2007, 06:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 05:56 PM.
twitter, follow us!