Jam/main.py

43 lines
1.0 KiB
Python

from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
from kivy.config import Config
from cross import Cross,Cross_painter
from status_bar import Status_bar
from command_prompt import Command_prompt
# App class
class Jam_app(App):
# name of .kv file for main interface
kv_file="jam.kv"
def build(self):
layout=BoxLayout(orientation="vertical")
# the file open for editing
self.openfile=""
# painter
self.painter=Cross_painter(self)
# status bar
self.status_bar=Status_bar(self)
# command prompt
self.command_prompt=Command_prompt(self)
layout.add_widget(self.painter)
layout.add_widget(self.status_bar)
layout.add_widget(self.command_prompt)
return layout
# disable red circles on right click
Config.set('input', 'mouse', 'mouse,disable_multitouch')
# do not exit on escape
Config.set('kivy', 'exit_on_escape', 0)
# run
if __name__ == '__main__':
Jam_app().run()