trueinteractions / tint2 Goto Github PK
View Code? Open in Web Editor NEWNative Javascript Applications
Native Javascript Applications
It will be handy to have some input on this, as I understand this could be managed with process.bridge
?
Tabs in OSX are pretty terrible, no one seems to commonly use them except for preferences.
Ran it several times and it fails all the time..
MacBook-Pro-Dmitri:tint dmitri$ ./runtests.sh
AppResources Cannot find icon at: app:///doesnotexist.js
✓
Buttons ✓
Dialog ✓
DockIcon ✓
DockMenu ✓
DropDown ✓
Events ✓
FileDialog ✓
Fullscreen assertion failed.
Error
at Object.assert (/Users/dmitri/github/tint/test/tools/utilities.js:27:42)
at null._onTimeout (/Users/dmitri/github/tint/test/fullscreen.js:25:12)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
Is it possible to change color of window tilte bar?
require('Application');
var Window = require('Window');
var appWin = new Window();
appWin.title = 'My title';
appWin.backgroundColor = '#000';
Maybe add smth like textColor
property into https://github.com/trueinteractions/tint2/blob/master/modules/Window/Window_mac.js ?
Few bugs here:
MacBook-Pro-Dmitri:tint dmitri$ ./build/Release/tint example.js
<unknown>:-1: Uncaught TypeError: Cannot read property 'native' of null
undefined:0
TypeError: Cannot read property 'native' of null
at Application.js:20:102
at core.js:252:31
at callback.js:49:23
content of example.js
-
require('Application');
var Window = require('Window');
var Button = require('Button');
var mainWindow = new Window();
var button = new Button();
mainWindow.title = 'DailyJS';
button.title = 'Hello';
button.addEventListener('mousedown', function() {
button.title = '^_^';
});
button.addEventListener('mouseup', function() {
button.title = 'Hello';
});
mainWindow.appendChild(button);
mainWindow.addLayoutConstraint({
priority: 'required',
relationship: '=',
firstItem: button,
firstAttribute: 'top',
secondItem: mainWindow,
secondAttribute: 'bottom',
multiplier: 0.0,
constant: 0.0
});
setInterval(function() {
button.title = Math.random();
}, 1000);
Hey there. Tried to build on OSX 10.9.4. Got the following error.
=== BUILD AGGREGATE TARGET postmortem-metadata OF PROJECT v8 WITH CONFIGURATION Release ===
Check dependencies
PhaseScriptExecution Action\ \"gen-postmortem-metadata\" /Users/james2doyle/Git/tint2/build/xcode/v8.build/Release/postmortem-metadata.build/Script-706D068250F96D05D0A09028.sh
cd /Users/james2doyle/Git/tint2/libraries/node/deps/v8/tools/gyp
/bin/sh -c /Users/james2doyle/Git/tint2/build/xcode/v8.build/Release/postmortem-metadata.build/Script-706D068250F96D05D0A09028.sh
=== BUILD AGGREGATE TARGET node_js2c OF PROJECT tint WITH CONFIGURATION Release ===
Check dependencies
PhaseScriptExecution Action\ \"node_js2c\" build/xcode/tint.build/Release/node_js2c.build/Script-5612098E818D48E4269AE8F5.sh
cd /Users/james2doyle/Git/tint2
/bin/sh -c /Users/james2doyle/Git/tint2/build/xcode/tint.build/Release/node_js2c.build/Script-5612098E818D48E4269AE8F5.sh
File "tools/js2c.py", line 57
print 'non-ascii value ' + filename + ':' + str(row) + ':' + str(col)
^
SyntaxError: invalid syntax
Command /bin/sh failed with exit code 1
Tried using python 3.4.1 and also 2.7.8 and still got the same errors. Any clue?
Looks like NSStatusMenuItem looks less like NSMenuItem than could be expected:
Looks like a simple string change in the case of imageHighlighted/setAlternateImage. In the case of imageOff, how do you feel about breaking backwards compatibility by removing it? Could alias it to image, but that seems like an unnecessary step, unless it's being used by someone.
I noticed another strange behavior while working with new Window
:
There is a code that is used for creating second window:
var aboutItem = new MenuItem('About '+application.name, '');
appleSubmenu.appendChild(aboutItem).addEventListener('click', function () {
var w = new Window();
w.x = 0;
w.y = 0;
w.width = 300;
w.height = 250;
});
Window jumps when changing dimensions in code for any instance of new Window
.
For example notice how smoothly window opens in another app:
require('Application');
Window = require('Window');
var mainWindow = new Window();
mainWindow.preferences.animateOnSizeChange = true;
mainWindow.preferences.animateOnPositionChange = true;
WebView = require('WebView');
var webView = new WebView();
mainWindow.appendChild(webView);
Toolbar = require('Toolbar')
var toolbar = new Toolbar();
Button = require('Button');
var backButton = new Button();
backButton.image = 'back';
var forwardButton = new Button();
forwardButton.image = 'forward';
toolbar.appendChild(backButton);
toolbar.appendChild(forwardButton);
TextInput = require('TextInput');
var urlLocation = new TextInput();
toolbar.appendChild('space');
toolbar.appendChild(urlLocation);
toolbar.appendChild('space');
mainWindow.toolbar = toolbar;
OS X: 10.10 (14A329r)
Xcode: 6.0
Tests failing:
Buttons
DropDown
Events
PopOver
ProgressBar
SelectInput
TextInput
Toolbar
WebViewTransparent
WebViewTransparent2
WebView
WindowStyle
They all fail with the same message:
An uncaught exception was raised
2014-08-27 23:26:09.373 tint[4663:143401] *** +[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]: A multiplier of 0 or a nil second item together with a location for the first attribute creates an illegal constraint of a location equal to a constant. Location attributes must be specified in pairs
2014-08-27 23:26:09.374 tint[4663:143401] (
0 CoreFoundation 0x00007fff9359bccc __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff91f356de objc_exception_throw + 43
2 CoreFoundation 0x00007fff9359bb7d +[NSException raise:format:] + 205
3 Foundation 0x00007fff8ccec076 VerifyConstraintArguments + 200
4 Foundation 0x00007fff8cab5fb2 +[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:] + 399
5 tint 0x000000010f675dcc ffi_call_unix64 + 76
)
2014-08-27 23:26:09.374 tint[4663:143401] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]: A multiplier of 0 or a nil second item together with a location for the first attribute creates an illegal constraint of a location equal to a constant. Location attributes must be specified in pairs'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff9359bccc __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff91f356de objc_exception_throw + 43
2 CoreFoundation 0x00007fff9359bb7d +[NSException raise:format:] + 205
3 Foundation 0x00007fff8ccec076 VerifyConstraintArguments + 200
4 Foundation 0x00007fff8cab5fb2 +[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:] + 399
5 tint 0x000000010f675dcc ffi_call_unix64 + 76
)
libc++abi.dylib: terminating with uncaught exception of type NSException
./run.sh: line 15: 4663 Abort trap: 6 $TINTEXEC tools/utilities.js $file
The rest works, great work!
https://github.com/trueinteractions/tint2/blob/master/modules/Dialog/Dialog_mac.js @ line 101, fix to unwrap JS to native object.
Windows only.
When ran interactively and a new window (WPF) is created, on some occasions the key input no longer fires on the console (however event callbacks and UV thread seems to stay operational).
This is actually a question.
Will we be able to interact with the OS. like watching the file system for changes, use windows task bar and show alerts ..etc
if not, to which extent will it be?
This causes significant pauses on interactive mode, in addition it causes poorer performance and some TCP events to be lost.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.