gallium.js v0.6.3
Why should I use Gallium JS?
Idk. It's just tkinter but for javascript. It's not that good, but it's better than nothing, especially if you don't know html and don't want to use electron.
Info
Gallium JS "converts" to python, so if you do not have python installed, it needs to be installed.
Font and Text changing (Text changing working only for labels) will come soon, issues with tkinter prevent the configuration of fonts (for everything) and text for buttons.
Example
const app = require('gallium.js');
app.init({
width: 800,
height: 500,
title: 'Gallium'
});
app.configure({
background: '#2b2b2b',
resize: false,
titlebar: true
});
app.button({
id: 'button',
text: 'Click me!',
width: 10,
height: 2,
x: 10,
y: 10,
background: 'red',
foreground: 'white',
});
app.onclick({
id: 'button',
background: 'green'
});
app.label({
id: 'label',
text: 'Hello, world!',
width: 10,
height: 2,
x: 10,
y: 100,
background: 'red'
});
app.onclick({
id: 'button',
background: 'green'
});
app.onclick({
id: 'label',
background: 'blue'
});
app.run();
This example looks like this:
Functions
app.init({
width: 800,
height: 500,
title: "Example"
});
This initializes the app but does not run the app.
app.configure({
background: 'grey',
resize: false,
titlebar: true
});
This configures the app. Titlebar changes whether the bar that shows the icon, title, and X button is shown. (This only works on windows)
app.button({
id: 'button',
text: 'Click me!',
width: 10,
height: 2,
x: 10,
y: 10,
background: 'red',
foreground: 'white'
});
Create a button with the id that will be called to use and configure the button, the text of the button, width, height, etc.
app.onclick({
id: 'button',
background: 'green'
});
When the object with the id is clicked, this will change the color.
app.label({
id: 'label',
text: 'Hello World!',
width: 10,
height: 2,
x: 10,
y: 10,
background: 'red',
foreground: 'white'
});
Create a label with the id that will be called to use and configure the label, the text of the label, width, height, etc.
app.run();
This runs the app.
app.draggable();
This makes the app draggable (Usefull if not having a title bar).
app.close({
after: 2000
run: 'echo App closed!'
})
This closes the app after 2 seconds (after is always in milliseconds) and runs the command echo App closed!
. Neither 'after' nor 'run' are required.
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago