How to use the gui.Window function in gui

To help you get started, we’ve selected a few gui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oyyd / react-yue / src / __tests__ / app.js View on Github external
}}
          style={{
            flex: 1,
            height: 1000,
          }}
        >
          {ITEMS.map(i =&gt; <label>)}
        
      
      <label> */}
    
  )
}

// Create a window and a root container:
const win = gui.Window.create({})
win.setContentSize({ width: 400, height: 250 })

const contentView = gui.Container.create()
contentView.setStyle({ flexDirection: 'row' })
win.setContentView(contentView)
win.center()
win.activate()

// Create your react elements and render them:
render(, contentView)

// Start your app
if (!process.versions.yode) {
  gui.MessageLoop.run()
  process.exit(0)
}</label></label>
github yue / node-gui / client / main.js View on Github external
new gui.Builder (__dirname + '/data/clip.glade', function (builder) {
    var window = builder.get ('window', gui.Window);
    window.show ();

    // Load configuration
    if (config.token) {
        // Auto login
        agent.autoLogin (config.token);
    } else if (config.first_time_using) {
        // Prompt for registing
    } else {
        // Prompt for username and password
        agent.login ('fool', '1234');
    }
});
github yue / wey / lib / service / slack / index.js View on Github external
createLoginWindow() {
    this.loginWindow = gui.Window.create({})
    this.loginWindow.setTitle('Login to Slack')
    this.loginWindow.onClose = () => this.loginWindow = null

    const contentView = gui.Container.create()
    contentView.setStyle({padding: 10})
    this.loginWindow.setContentView(contentView)

    const row1 = this.createRow(contentView)
    const label11 = gui.Label.create('Workspace')
    row1.addChildView(label11)
    const labelWidth = label11.getBounds().width + 5
    label11.setAlign('start')
    label11.setStyle({minWidth: labelWidth})
    const teamInput = gui.Entry.create()
    teamInput.setStyle({flex: 1})
    row1.addChildView(teamInput)
github yue / wey / lib / view / chat-window.js View on Github external
constructor(messageList, bounds) {
    this.window = gui.Window.create({})
    this.chatBox = new ChatBox(this)
    this.window.setContentView(this.chatBox.view)
    this.window.setContentSize(bounds)

    let title = messageList.account.name
    if (messageList.type === 'channel')
      title += ` | ${messageList.name}`
    else if (messageList.type === 'thread')
      title += ` | ${messageList.channel.name} | Thread`
    this.window.setTitle(title)

    this.chatBox.loadChannel(messageList)

    windowManager.addWindow(this)
  }
github oyyd / react-yue / src / do_space / login.js View on Github external
export function createConnectWindow(next) {
  try {
    const connectionWindow = gui.Window.create({})
    connectionWindow.setTitle('connect')
    connectionWindow.setContentSize({ width: 440, height: 200 })
    connectionWindow.setAlwaysOnTop(true)

    const container = gui.Container.create()
    container.setStyle({ flexDirection: 'row' })
    connectionWindow.setContentView(container)

    render(
       {
          next(...args)
          connectionWindow.close()
        }}
      /&gt;,
      container
github yue / wey / lib / view / main-window.js View on Github external
constructor() {
    this.window = gui.Window.create({})
    this.window.setTitle(require('../../package.json').build.productName)
    const contentView = gui.Container.create()
    contentView.setStyle({flexDirection: 'row'})
    this.window.setContentView(contentView)
    this.accountsPanel = new AccountsPanel(this)
    contentView.addChildView(this.accountsPanel.view)
    this.channelsPanel = new ChannelsPanel(this)
    contentView.addChildView(this.channelsPanel.view)

    this.chatBox = new ChatBox(this)
    contentView.addChildView(this.chatBox.view)

    this.channelsSearcher = new ChannelsSearcher(this)
    this.channelsSearcher.view.setVisible(false)
    contentView.addChildView(this.channelsSearcher.view)