Skip to content
This repository was archived by the owner on Sep 21, 2024. It is now read-only.

Importing as a Python module

Vitor Lopes edited this page Jun 17, 2018 · 6 revisions

Create a file myapp.py drop in the code below.

Jade application kit will look for all needed additional files in the directory were myapp.py resides.

Example:

#!/usr/bin/env python3
# coding: utf-8
from j.AK import Api, AppWindow

from gi.repository import Gtk, WebKit2


class applicationWindow(AppWindow):
    """
    extends AK.AppWindow functionality
    """

    def __init__(self):

        super(applicationWindow, self).__init__()

        ## custom html
        
        #AK.Api.html = """
        #<h1>jade Application Kit rocks</h1>
        #<p>hey my app is great<p>
        #"""

        ## custom JavaScript

        #AK.Api.javascript += """
        #alert("Testing JavaScript");
        #"""

        # more code here

        ## only if loading a url

        #URL = "http://my-url.com"
        #self.webview.load_uri(URL)


applicationWindow()
Gtk.main()
Clone this wiki locally