egui (pronounced "e-gooey") is a simple, fast, and highly portable immediate mode GUI library for Rust.
Questions tagged [egui]
47 questions
0
votes
0 answers
What are the differences between FontId, FontFamily and FontSelection? How do I select font in egui?
I am trying to understand how a font style and size works in egui "0.19.0".
For example I wish to choose the font style and size of text in a TextEdit box. Here is what I have tried.
ui.add(
TextEdit::multiline(&mut ss)
…

Isaac Dzikum
- 184
- 9
0
votes
1 answer
egui epaint loading image - dimensions problem
I am getting an image error that I'm guessing is dimension-related, since the left and right change whenever I change the image loading size variables. The program compiles but crashes on start.
This is my code, I'm inserting a PNG image into an…

tommy1213
- 93
- 1
- 5
0
votes
1 answer
Reference got from mutex'a value doesn't live enought
I'm learning Rust and trying to create a Admin panel like with egui and multi-threading;
One thread which update the Student struct in an Hashmap && another which run egui and display Student information;
here the problem, I have:
students:…

Ectaclick
- 5
- 2
0
votes
0 answers
Egui: How to disable capturing mouse movement?
I'm making an app with egui (Rust) and i want to disable the window from capturing mouse movement, i can't find anything in the context creation that allows me to do so.
run_native(
NativeOptions::default(),
Box::new(|ctx| {
…

Hyrulia
- 3
- 1
0
votes
1 answer
What code mistake can cause egui to not detect a click?
I have created my first egui app. The update loop looks like
impl eframe::App for App {
fn update(&mut self, ctx: &Context, _frame: &mut Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
…

Mutant Bob
- 3,121
- 2
- 27
- 52
0
votes
1 answer
rust egui, geoemtry isn't clipped
I am trying to use egui with a custom renderer I made. I am rendering to the screen, but it looks like this:
i.e. the widget occupies the entire screen. When I inspect the data I get from egui
let output = self.ctx.run(raw_input, |ctx|
…

Makogan
- 8,208
- 7
- 44
- 112
0
votes
1 answer
rust vulkan, egui, how do you get the font atlas data? (also are these the right shaders?)
I am trying to integrate egui with a renderer I made.
Looking at the dos I find this snippet where they explain how to integrate the library:
let mut ctx = egui::Context::default();
// Game loop:
loop {
let raw_input: egui::RawInput =…

Makogan
- 8,208
- 7
- 44
- 112
0
votes
1 answer
EGui with glfw in rust
Currently learning openGL in rust and decided to add e-gui, to make immediate changes.
Decided to use this crate: https://crates.io/crates/egui_glfw_gl/0.13.1
After adding it to Cargo.toml can't build or run.
PS opengl_t_2> cargo run
Compiling…

Vasily Levitskiy
- 3
- 5
0
votes
1 answer
Syntax highlighting in egui Rust
I'm writing a text editor in Rust using egui. I am trying to implement syntax highlighting,
so I followed the example in the demo. It works there, so I thought it might be useful. But I am getting an error that syntax_highlighting is not found in…

VideoCarp
- 35
- 1
- 2
- 7
0
votes
1 answer
How stop auto refresh of egui screen
I have the following menu item
fn update(&mut self, ctx: &egui::Context, frame: &epi::Frame) {
//let Self { label, value } = self;
// Examples of how to create different panels and windows.
// Pick whichever suits you.
// Tip: a…

John
- 1
- 3
0
votes
2 answers
Convert glow::Framebuffer to u64
egui::Image::new can take a User(u64) as the first parameter. I have a glow::Framebuffer that I want to pass to the function like
egui::Image::new(User(frame_buffer), egui::Vec2::new(1280.0, 720.0));
It looks like glow::Frambuffer is a…

Grayden Hormes
- 855
- 1
- 15
- 34
-1
votes
0 answers
egui-macroquad compile & runtime errors
I wanted to make a simple automation game using Rust, I first tried Bevy but didn't like ECS. So I found Macroquad, which looked great, but the ui was messy and I found it hard to use, so I wanted to use egui-macroquad to use egui for ui's which…

Sxmourai
- 9
- 1
-1
votes
1 answer
expected mutable reference `&mut egui::ui::Ui` found mutable reference `&mut Ui` should not be happening
Here is the repo im using as a reference for adding a image:
https://github.com/emilk/egui/blob/master/examples/retained_image/src/main.rs
Im getting this error when trying to draw a image to the screen on this line of…

Terrell-byte
- 49
- 8
-1
votes
1 answer
Share database connection between many structs
In my program I need to share connection between many struct for updating data in database.
I use rusqlite for my database
and egui for my GUI
Here my source code.
I put a FIXME in the file counter.rs.
I implemented Widget for displaying data…

Ectaclick
- 5
- 2
-1
votes
1 answer
How can I mutate the contents of an optional Vec?
I'm trying to learn rust with egui, and I'm trying to make a list of checkboxes.
struct Checkbox {
check: bool,
text: String
}
Eventually, the borrow checker doesn't like this code:
// There is a parameter &mut self
// self.header:…

Kenkron
- 573
- 1
- 3
- 15