Recent Posts
None | 6 sec ago
None | 11 sec ago
C++ | 13 sec ago
C# | 22 sec ago
None | 22 sec ago
C# | 50 sec ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By alf on the 9th of Feb 2010 08:08:33 PM Download | Raw | Embed | Report
  1. # -*- coding: utf-8 -*-
  2.  
  3. from pymt import *
  4.  
  5. class TestWidget(MTScatterWidget):
  6.  
  7.     def __init__(self, **kwargs):
  8.  
  9.         super(TestWidget, self).__init__(**kwargs)
  10.  
  11.         self.pos = (0,0)
  12.         self.size = (100, 100)
  13.  
  14.     def on_touch_down(self, touch):
  15.  
  16.         print '-------------------------------------'
  17.         print 'widget pos: ', self.pos
  18.         print 'widget center pos: ', self.center
  19.         print 'widget to_local: ', self.to_local(self.x, self.y)
  20.         print 'widget to_window: ', self.to_window(self.x, self.y)
  21.         print 'widget to_widget: ', self.to_widget(self.x, self.y)
  22.         print 'widget.to_parent: ', self.to_parent(self.x, self.y)
  23.  
  24.         super(TestWidget, self).on_touch_down(touch)
  25.  
  26. if __name__ == "__main__":
  27.  
  28.     button = TestWidget()
  29.  
  30.     window = getWindow()
  31.     window.add_widget(button)
  32.     runTouchApp()
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: