Questions tagged [egui]

egui (pronounced "e-gooey") is a simple, fast, and highly portable immediate mode GUI library for Rust.

47 questions
3
votes
1 answer

Rust egui window size and dark mode

I'm tring to make a native gui app using egui. After some time got the hello_world example to compile.Heres the code: use eframe::{epi, egui}; struct MyEguiApp { name: String, age: u32, } impl Default for MyEguiApp { fn default() ->…
Topster_
  • 45
  • 1
  • 4
2
votes
0 answers

How to close the window in egui

Well, strange question, I'm using egui and macroquad, showing LogsWindow over CentralWindow. But I just can't close it using click on the cross (.open() method for Window object). pub struct LogsWindow<'a> { pub is_opened: &'a mut bool, pub…
taciturno
  • 175
  • 2
  • 10
2
votes
1 answer

Why is my OpenGL Texutre render darkened? (The RGB values are squared)

I've been using glow to do some opengl rendering in rust. It's going well, but rendering to a texture vs. rendering to an image gives me different results. I know a naive way to solve it, I just don't understand it. The image on the right is…
Kenkron
  • 573
  • 1
  • 3
  • 15
2
votes
1 answer

How to set margins or indents in egui?

I am using a custom window in EGUI with Rust and have been quite impressed with the rust language and this gui library, but have hit a brick wall with something that I would think should be fairly straightforward. How do I indent the labels in this…
SysRisk
  • 21
  • 1
  • 4
2
votes
1 answer

How do I make my own window frame in egui (eframe) Rust

Here is how I start my app and remove the window frame: let app = RustClicker::default(); let mut native_options = eframe::NativeOptions::default(); native_options.decorated = false; // I remove window frame here …
NightmareXD
  • 425
  • 1
  • 4
  • 14
2
votes
1 answer

How to display an image in real-time using Rust?

I am trying to write a ray tracer and want to render my image in real time in a GUI window. Basically, I have a buffer: Vec that is constantly updating. The question is how do I display it on the screen after completing each row. I was thinking…
1
vote
1 answer

Updating struct field with slider value in Nannou

I am trying to learn Rust by creating animations using Nannou. The animation consists of circles that move according to a mathematical function, and I want to add a slider to the GUI to control the number of circles by following this code I have…
AltunE
  • 375
  • 3
  • 10
1
vote
1 answer

Simplest way to display an image from a filepath?

So far, the only way i've found to do this is In order to display an image in rust using egui, I have to Use the image crate to read in a DynamicImage from a file Convert that DynamicImage to an ImageBuffer Convert that ImageBuffer into a…
Dr. Slate
  • 31
  • 4
1
vote
0 answers

egui: how to know if a window or an area has been moved to top?

I have an object, which implements egui App trait. When I run this object, a main egui window appears with several windows and areas inside it. When updating this object, I want to know if some window/area is on top (within the object main egui…
FreD
  • 393
  • 2
  • 12
1
vote
1 answer

Rust Egui, how do i set the color of a heading?

I am trying to create a heading in my Rust egui code and set its color to white, but I am unsure of how to do so. My code currently includes a function render_date that uses the colored_label function to display a date string on the screen in white…
1
vote
1 answer

How is it possible that i cant use this function?

using this github repo as a reference: https://github.com/emilk/egui/blob/master/examples/retained_image/src/main.rs Im trying to load an image into my frame using the egui_extras::RetainedImage, but it is giving me an error that the function…
1
vote
0 answers

How to make hovering text for a custom coordinates in Rust using egui?

I'm trying to make visualization for iterative algorithm, using macroquad and egui. Pure plot on macroquad looks like this: Note that each circle or vertice is a struct instance with N fields, content from which I want to appear with hovering over…
taciturno
  • 175
  • 2
  • 10
1
vote
0 answers

Select the text of a TextEdit object in egui

Is it possible to select all of the text in a TextEdit widget upon a double-click event? I know how to detect the double-click event, I just can't see any way to select all text. let text_edit = egui::TextEdit::singleline(&mut…
user1503949
  • 357
  • 5
  • 10
1
vote
2 answers

What is the best way to update app fields from another thread in egui in rust

I'm trying to run a function in another thread that updates app fields every second and window accordingly. But I don't know how to do that. What is the best way to do that? I tried to use Arc. #![cfg_attr(not(debug_assertions), windows_subsystem =…
QKQL
  • 23
  • 1
  • 5
0
votes
0 answers

Sending data between threads using MPSC channels sometimes takes 5-10 seconds, possible thread starvation?

I am trying to send some data between two threads but it is taking upwards of 5-10 seconds for it to be received on the other thread. The main thread is running a GUI (written in egui), and when the user clicks a button, it spawns the second thread,…
birdistheword99
  • 179
  • 1
  • 15
1
2 3 4