Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please give an example how eventhandlers ar used. #13

Open
rockiger opened this issue May 9, 2019 · 5 comments
Open

Please give an example how eventhandlers ar used. #13

rockiger opened this issue May 9, 2019 · 5 comments

Comments

@rockiger
Copy link

rockiger commented May 9, 2019

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.

@clayrisser
Copy link
Owner

@rockiger sorry I don't have events supported yet. I will try and get it working soon.

I would love to know what you are using this project for. Would love to feature it in the README.md.

@rockiger
Copy link
Author

Hi, I would like to convert my electron app Akiee to react-gtk. Right now it is an Electron app with React and Blueprintjs.

I tried to use proton-native. But the cross platform approach of proton doesn't work for me. It uses the smallest common denominator on any platform. I think a "learn once write anywhere" approach is much more feasible.

I think an approach with

  • react-style declarative programming, that has a great user base,
  • reactive state management and
  • has access to the node ecosystem

is pure gold for the Linux ecosystem. So far Linux has Python and Qt which imo sucks in comparison to Electron and React.

Let me know if I can be of any assistance. I am mainly involved with web programming, but maybe I can learn something to help you.

@clayrisser
Copy link
Owner

So the goal of react-gtk is ultimately to have 2 projects. react-gtk is a direct mapping to the gtk library, so names of components and events basically match the gtk docs.

react-native-gtk will be built on top of react-gtk and will ultimately have an identical api to react-native.

Right now the biggest way you can help is just use the project and report bugs.

@clayrisser
Copy link
Owner

Building examples and documentation is always welcome too :)

@clayrisser
Copy link
Owner

Sorry for the long long wait. We will have a stable version of this with GTK4 support ready by Christmas 2023! Please join the discord for live updates and feedback.

https://discord.gg/qv7GT5xctw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants