emilk / emilk/egui

Alternative version of callback-taking functions for making API bindings

Open
#1,004 18 comments 5 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

I'm working out how to wrap egui's API for my scripting language. Something that would make this a lot easier is if there was an alternative API to the functions that take callbacks (like `SidePanel::show`, `Window::show`, and `Ui::horizontal`) which could be written in straight-line code. For example, an object that exposes a `&mut UI` to draw widgets, and has a `finish` method which drops it.

It looks like I can emulate this with some pairs of `Ui::new` and `Ui::allocate_rect`, but I'll have to rewrite all the useful stuff those functions do.

Contributor guide

Open the contributing guide

Research direction

Start by examining the callback-taking APIs named in the issue: SidePanel::show, Window::show, and Ui::horizontal. Compare their behavior with the mentioned Ui::new and Ui::allocate_rect approach, then determine the lifecycle and ownership requirements for an object exposing &mut Ui with a finish method. Done means a coherent alternative API that supports equivalent straight-line widget construction.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.