i need help on coding
Posted: 17 March 2011 02:21 AM   [ Ignore ]
Rank
Joined  2011-03-01
Total Posts:  4
New Member

i m a beginner and don know anything about pymt , need help to do coding just like the picture below

Untitled.png

when i push the button arts or maths it should open another .py file ......
pls some one help me........

Profile
 
 
Posted: 17 March 2011 07:09 PM   [ Ignore ]   [ # 1 ]
Avatar
RankRankRank
Joined  2009-06-09
Total Posts:  268
Sr. Member

What do you mean by ‘open another .py file’? What exactly is in that other file and what do you want to happen?

In general, you can connect callbacks to the Buttons’ on_release events:

def my_callback(*args):
    print 
'Button has been pressed with'args

my_button
.connect('on_release'my_callback)

 Signature 

My Blog
PyMT—Create Multitouch Software easily!
Movid—New cross-platform tracker, work in progress!

Profile
 
 
Posted: 07 April 2011 04:05 AM   [ Ignore ]   [ # 2 ]
Rank
Joined  2011-03-01
Total Posts:  4
New Member

from os.path import join, dirname, exists
from pymt import *

urrent_dir = dirname(__file__)

layout = MTBoxLayout(orientation=’horizontal’, spacing=10, padding=10, pos=(350, 350))

button1 = MTButton(label=’BTN1’)
button2 = MTButton(label=’BTN2’)
layout.add_widget(button1)
layout.add_widget(button2)

getWindow().add_widget(layout)
runTouchApp()

this are the codes, i need help in inserting images to the button? to make button look like an image??

Profile