sciter-sdk / pysciter

Python bindings for Sciter
https://sciter.com
MIT License
395 stars 40 forks source link

Hiding source codes #11

Open Eliyanan opened 7 years ago

Eliyanan commented 7 years ago

Hello pravic, i wanted to do the UI code inside my .py source code. is that possible. i didnt want to expose all my styling and tiscript code.. because anybody can edit it. thanks.

pravic commented 7 years ago

In general, there is a Host.set_html (usually called from Window), so you can keep your resources anywhere (in zip with password, in encrypted file, on your server, etc.).

Also take note about Host.on_load_data, where you can intercept resources load requests and override with your own path:

HTML loaded into Sciter may contain external resources: CSS (Cascading Style Sheets), images, fonts, cursors and scripts. To get any of such resources Sciter will first send SC_LOAD_DATA notification to your application using callback function defined in code of your application. Your application can

  • provide your own data for such resources (for example from resource section, DB or other storage of your choice)
  • or delegate resource loading to built-in HTTP client and file loader
  • or discard loading at all.

http://sciter.com/developers/embedding-principles/