From efa4d0772005cd342264368218618795f5f33478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B3=A0=EB=82=A8=ED=98=84?= Date: Mon, 26 Oct 2020 17:52:27 +0900 Subject: [PATCH] fix --- lib/{gtkserver.js => gtk.js} | 49 +++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 20 deletions(-) rename lib/{gtkserver.js => gtk.js} (79%) diff --git a/lib/gtkserver.js b/lib/gtk.js similarity index 79% rename from lib/gtkserver.js rename to lib/gtk.js index cc27ec6..63609d3 100644 --- a/lib/gtkserver.js +++ b/lib/gtk.js @@ -2,6 +2,8 @@ // GTKServer API //////////////////////////////////////////////////////////////////////// +var SHELL = require("lib/shell"); + // set binPath var binPath = "bin\\gtk-server.exe"; @@ -10,15 +12,15 @@ var GTKElements = []; // Common (Element) var GTKElement = function() { - this.Type = "GTKElement"; - this.Width = 0; - this.Height = 0; + this.type = "GTKElement"; + this.width = 0; + this.height = 0; this.setWidth = function(width) { - this.Width = width; + this.width = width; }; this.setHeight = function(height) { - this.Height = height; + this.height = height; }; this,onchange = function() {}; @@ -38,12 +40,20 @@ var GTKElement = function() { GTKElements.push(this); }; +// start GTKServer +var = function() { + SHELL.run([ + binPath, + "-stdin" + ]); +}; + // Window var Window = function() { GTKElement.apply(this, arguments); - this.Type = "Window"; - this.Title = "WelsonJS GTK GUI Application"; + this.type = "Window"; + this.title = "WelsonJS GTK GUI Application"; this.setTitle = function(title) { this.Title = title; }; @@ -55,7 +65,7 @@ Window.prototype.constructor = Window; var Table = function() { GTKElement.apply(this, arguments); - this.Type = "Table"; + this.type = "Table"; this.attach = function(element, left, right, top, buttom) { // TODO: Table.attach() }; @@ -67,12 +77,11 @@ Table.prototype.constructor = Table; var Button = function() { GTKElement.apply(this, arguments); - this.Type = "Button"; - this.Text = "New Button"; + this.type = "Button"; + this.text = "New Button"; this.setText = function(text) { this.Text = text; }; - }; Button.prototype = new GTKElement(); Button.prototype.constructor = Button; @@ -81,10 +90,10 @@ Button.prototype.constructor = Button; var Label = function() { GTKElement.apply(this, arguments); - this.Type = "Label"; - this.Text = "New Label"; + this.type = "Label"; + this.text = "New Label"; this.setText = function(text) { - this.Text = text; + this.text = text; }; }; Label.prototype = new GTKElement(); @@ -94,8 +103,8 @@ Label.prototype.constructor = Label; var RadioBox = function() { GTKElement.apply(this, arguments); - this.Type = "RadioBox"; - this.Text = "New RadioBox"; + this.type = "RadioBox"; + this.text = "New RadioBox"; this.setText = function(text) { this.Text = text; }; @@ -107,8 +116,8 @@ RadioBox.prototype.constructor = RadioBox; var CheckBox = function() { GTKElement.apply(this, arguments); - this.Type = "CheckBox"; - this.Text = "New CheckBox"; + this.type = "CheckBox"; + this.text = "New CheckBox"; this.setText = function(text) { this.Text = text; }; @@ -120,8 +129,8 @@ CheckBox.prototype.constructor = CheckBox; var TextBox = function() { GTKElement.apply(this, arguments); - this.Type = "TextBox"; - this.Text = "New TextBox"; + this.type = "TextBox"; + this.text = "New TextBox"; this.setText = function(text) { this.Text = text; };