How to use the @nodegui/nodegui.QPushButtonEvents.clicked function in @nodegui/nodegui

To help you get started, weโ€™ve selected a few @nodegui/nodegui 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 nodegui / react-nodegui / examples / weather-app-widget / src / index.tsx View on Github external
getWeather();
  }, []);

  const getWeather = useCallback(async () => {
    try {
      const data = await getCurrentWeather();
      setWeather(data);
    } catch (err) {
      console.log(err);
    }
  }, []);

  const summary = weather.weather[0] || {};
  const refreshHandler = useEventHandler(
    {
      [QPushButtonEvents.clicked]: async () => {
        setWeather(defaultState);
        await getWeather();
      }
    },
    []
  );
  const quitHandler = useEventHandler(
    {
      [QPushButtonEvents.clicked]: () => {
        QApplication.instance().quit();
      }
    },
    []
  );

  return (
github nodegui / examples / nodegui / calculator / src / index.ts View on Github external
const getButton = (
  label: string,
  value: number | string,
  type: "value" | "command"
) => {
  const button = new QPushButton();
  button.setText(label);
  button.setObjectName(`btn${value}`);
  button.addEventListener(QPushButtonEvents.clicked, () => {
    onBtnClick(value, type);
  });
  return {
    ui: button,
    value,
    type
  };
};
github nodegui / react-nodegui / examples / image-view / index.tsx View on Github external
() => ({
      [QPushButtonEvents.clicked]: () => {
        setImageSrc(fileUrl);
      }
    }),
    [fileUrl]
github nodegui / react-nodegui / examples / calculator / index.tsx View on Github external
<button id="opBtnY">
          
          </button><button id="valueBtn">
            </button><button id="valueBtn">
            </button><button id="valueBtn">
            </button><button id="opBtnY">
          
          </button>