Skip to content

Please give an example how eventhandlers ar used. #13

@rockiger

Description

@rockiger

Hello, awesome project! I believe this project and the node-gtk project could boost app development on Linux.

I am trying to recreate the gjs tutorial and I can't figure out how to do event handling.

For example I want to do handle a click event on a button:

import React, { Component } from 'react';
import { render, Button, Box } from '@react-gtk/binding';

class App extends Component {

    

  onClicked() {
      console.log("clicked");
      
  }
  render() {
    return (
        <Button label="Click Here" clicked={this.onClicked} />
    );
  }
}

render(<App />, 'Hello World');

The event name would be clicked but I don't know how to handle the event in my component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions