Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
21 views

I have been trying to implement a simple drag and drop application in Gtk 4 Rust but I am unable to implement a working version. I can see connect_accept getting triggered, but no matter the result, ...
Margus Laak's user avatar
0 votes
0 answers
17 views

Dispose tempalte disposes only bound widgets. Is there a way to dispose all children graph? Here are the details. Object implementation: #[derived_properties] impl ObjectImpl for MyWidget { ...
Dennis Tretyakov's user avatar
0 votes
1 answer
51 views

I've been struggling with this for a while, and I've almost got it- but not quite. This is what I have so far: pub fn load_folder_view(state: &mut State) { let path = state.current_folder_path....
Cyncrovee's user avatar
0 votes
0 answers
70 views

I'm trying to develop a widget in gtk4 as follows: let container = Box::new(Orientation::Horizontal, 0); let workspace_num = Label::new(Some("11")); let workspace_num_box = gtk4::Box::new(...
Bishal's user avatar
  • 1
0 votes
0 answers
72 views

Right now I have some simple code that looks like this: let window = gtk4::ApplicationWindow::new(application); window.set_default_size(1920, 1080); let file = <setup for a functional path>; ...
Kyle Malling's user avatar
0 votes
0 answers
48 views

I'm trying to bind the RGBA property of a ColorDialogButton in a GTK4 application in rust. However, Glib always throws me some variation of 'rgba' on class 'GtkColorDialogButton' has type 'GdkRGBA' ...
NepNep-NepNep's user avatar
0 votes
0 answers
75 views

I followed this post and I was able to successfully the channels and global resources. However, when I invoke the sender thread it says that the RefCell that contains my sender and global resource is ...
NepNep-NepNep's user avatar
0 votes
1 answer
57 views

I use gtk4-rs to build a gui program. the 1st parameter of the select_folder function shows an error: "the trait bound ObjectImplRef<imp::Window>: IsA<gtk4::Window> is not satisfied&...
Pining Doggie's user avatar
0 votes
1 answer
49 views

I'm trying to modify a pixbuf when the left mouse button is clicked but I don't think it's being modified. The modify_pixel function simply takes a specific pixel from the pixbuf and modifies it. fn ...
zerowanderer's user avatar
0 votes
1 answer
854 views

RHEL 9.4 does not have the PKG_CONFIG_PATH environment variable configured even though pkg-config is installed. Therefore, cargo cannot build pango-sys because the pango.pc file is needed. Setting the ...
Joshua Shane Martin's user avatar
1 vote
0 answers
120 views

I am trying to implement a wayland lockscreen using the ext-session-lock-v1 protocol. However, due to the protocols design, the UI has to be rendered on custom pre-designated surfaces assigned for the ...
IHaxYou's user avatar
  • 73
0 votes
1 answer
357 views

I'm trying to connect the signal from this UI file: <interface> <object class="GtkApplicationWindow" id="appwin1"> <child> <object class="...
Predrag Manojlovic's user avatar
0 votes
1 answer
94 views

I have been working hard on my own text editor as a way to learn Rust. But even with the help of ChatGPT and the entirety of Stack Overflow already asked questions I have reached a roadblock. I cant ...
Daniel McLarty's user avatar
0 votes
1 answer
934 views

I recently started using GTK4 with gtk-rs for an application I am creating. I don't like the way the default titlebar ever looks, and I want to remove it. I want to keep the other decorations, such as ...
DischordDynne's user avatar
0 votes
1 answer
192 views

I have custom subclass of gtk::Box, I need to make it calculate width based on parent(50% for example) and height using aspect ratio that needs to be specified. I tried implementing size_allocate ...
Rostcraft's user avatar
0 votes
1 answer
439 views

I wonder what is necessary to render theme aware icons in gtk-rs (GTK4) on Windows. I added icons to resources and can successfully render PNG files. Drop-in replacement with SVG does not render ...
fragsalat's user avatar
  • 548
0 votes
0 answers
127 views

What I wanna do is set the selected item in ComboboxText. I know that should be done using set_active() method, but that requires a position (index). All I have is the selected value (string). So I ...
user2297996's user avatar
  • 1,624
0 votes
0 answers
58 views

In nutshell, I wanna create this func (not valid Rust): fn foo<T: IsA<CheckButton> | T: IsA<ToggleButton>>(...) { ... widget.is_active() // where widget is either a ...
user2297996's user avatar
  • 1,624
3 votes
3 answers
271 views

I'm trying to get the state of a gtk.CheckButton using Action since gtk docs says: When the code must keep track of the state of a group of radio buttons, it is recommended to keep track of such ...
raven's user avatar
  • 1,213
2 votes
1 answer
486 views

I am new to rust and GTK. I'd like to create a glib::MainContext::channel() pair prior to initializing my gtk::Application. I believe this can be thought of exactly like a std::sync::mpsc. And while I ...
awm129's user avatar
  • 437
1 vote
3 answers
127 views

I'm trying to reduce the load time of a ColumnView widget with lots of rows. quoting from gtk list widget documentation: While it is not a problem for short lists to instantiate widgets for every ...
raven's user avatar
  • 1,213
0 votes
1 answer
125 views

I want to perform a render on click event on the GLArea. The problem is that when I call the drawing method from the event handler, the "canvas" does not change. There is the my_draw_func() ...
RedGradient's user avatar
0 votes
1 answer
564 views

I'm using gtk-rs with GTK4. I have a custom widget representing a row in a GtkListView widget. My custom widget (MyRow) is defined exactly as done in the book (see https://github.com/gtk-rs/gtk4-rs/...
Nicolas's user avatar
  • 7,209
0 votes
1 answer
94 views

I was trying to make a button that would get the contents of an entry box and print it to the terminal but I couldn't really find anything that helped. Could anyone help me? I looked for solutions but ...
sxtj's user avatar
  • 1
0 votes
1 answer
279 views

I can do like let button = Button::builder().label("Click me..!") .tooltip_text("You have to click this..!") .margin_top(...
Redu's user avatar
  • 26.3k
0 votes
1 answer
298 views

How can I write a custom Container in gtk-rs for GTK-3? I use gtk-rs 0.15.0 (to be compatible with the last GTK-3 compatible version of webkit2gtk). I couldn't find any reasonable documentation. ...
Jan Diederich's user avatar
0 votes
1 answer
122 views

How do I get the parent of a CompositeTemplate in gtk-rs? #[derive(Debug, Default, gtk::CompositeTemplate)] #[template(resource = "/org/bil4x4/gnote/tree_view")] pub struct ...
Bill Payne's user avatar
-3 votes
1 answer
746 views

I have a vector of strings and a method that is accepting [&str]. When I provide the strings as string literals everything works however when I try to build the same vector dynamically using ...
John554's user avatar
  • 354
0 votes
1 answer
78 views

I'm using gtk-rs. I want to trigger some code after the window has been shown (has displayed on the screen): window.connect_show(clone!(@weak window => move |_| { let command = format!("...
wyc's user avatar
  • 55.7k
0 votes
0 answers
360 views

I am having some trouble loading additional icons into a IconTheme. At the moment my code is adding the path which is showing correctly with search_path() however it always returns false when I check ...
John554's user avatar
  • 354
1 vote
1 answer
431 views

What is the standard method for updating UI elements from a loop calling a web request in Rust using gtk-rs? I am having trouble updating a label in a UI element to display some data from a web ...
John554's user avatar
  • 354
0 votes
1 answer
187 views

I am trying to write a small app in gtk-rs that takes an input and checks if it is correct against a value and displays an error if it is not. I am struggling with handling the code to display the ...
John554's user avatar
  • 354
0 votes
2 answers
750 views

Is it possible to set the maximum size for a window in gtk-rs? When reading the documentation I can find lots of options to set the minimum window size and the default window size however I can not ...
John554's user avatar
  • 354
0 votes
1 answer
214 views

I am using gtk-rs to build an application and currently I am having some trouble adjusting the width of the buttons when using StackSwitcher. I have tried using CSS for this as the gtk-rs book seems ...
John554's user avatar
  • 354
0 votes
1 answer
361 views

I am have a gtk-rs application where a Gtk::Entry is used to get user input when the user hits a submit button. Everything compiles and runs however I can not get the user input outside of the method ...
John554's user avatar
  • 354
0 votes
1 answer
635 views

I am using gtk-rs to build a small application and I am struggling with the concept of changing the widgets displayed on a page. So far I have been working through this guide but I have not found the ...
John554's user avatar
  • 354
1 vote
1 answer
613 views

I have a small gtk-rs application where I am trying to display an input field and get the input from the user. At the moment I can't get the input from the input field when the user clicks the button. ...
John554's user avatar
  • 354
0 votes
1 answer
189 views

This working Rust code repeats itself somewhat: fn append_column(tree: &TreeView, attribute: &str, id: i32) { let column = TreeViewColumn::new(); match attribute { "text&...
DobbyTheElf's user avatar
0 votes
1 answer
424 views

I'm struggling to pass a method as a callback function, when calling connect_activate() on a gtk::Application, as shown in the code below. I've made a closure to avoid troubles concerning the &...
LRMAAX's user avatar
  • 301
0 votes
1 answer
274 views

I am porting a working gtk-rs application from gtk3 to gtk4. The following code is a reduced self-contained example to demonstrate the Problem. The code is for gtk3 with the changes required for gtk4 ...
Donald's user avatar
  • 19
1 vote
0 answers
249 views

I have recently started working with gtk-rs for the first time and I'm trying to use an svg file defined in a css file as the background for a box. All my css on my other elements load in perfectly ...
macl's user avatar
  • 11
1 vote
0 answers
621 views

I am trying to build a hello world project to see if gtk4-rs is working correctly, which always fails at creating the binaries. The rest of the build seems to fine (tried to run cargo clean and cargo ...
valhrafnaz's user avatar
1 vote
1 answer
261 views

I'm trying to write a basic multithreaded application using gtk3-rs, where the main thread sends a message to a child thread when a button is clicked, and the child thread sends a message back in ...
Alexis Purslane's user avatar
2 votes
1 answer
258 views

I am trying to build an Application in Rust with gtk-rs. When the user creates a new project the path to the project root needs to be stored in some way so that it is accessible to all of the ...
C. Dautermann's user avatar
1 vote
1 answer
689 views

I am basically following the gtk-rs book to create a simple app. I have the following rust struct, which I want to display in a ListView. This struct is basically read-only and should not be edited, ...
Hellstorm's user avatar
  • 680
0 votes
1 answer
212 views

How I can update child widget of gtk::Grid (gtk::Label in example) in runtime? In example code after change value SpinButton, I add recreated Grid (fn grid()) with updated childs (I don't want remove ...
Aiany's user avatar
  • 23
0 votes
1 answer
552 views

New to Rust and I'm trying to build a simple Rust GUI using gtk-rs following the docs here. What I'm wondering is whether it's possible to pass around the window that gets built in the build_ui ...
jschuss's user avatar
  • 675
-1 votes
1 answer
303 views

I'm trying to make a simple window with gtk4-rs i honestly can't find documentation for how to call the main gtk loop use gtk::prelude::*; fn main() { // call gtk::init() to initialize gtk. ...
BlueberryBush's user avatar
0 votes
1 answer
1k views

I am trying to build a gtk-4 GUI application with the Rust in VScode, but I am unable to because I can't build my project. What could be the problem? How do I fix it? Here's the error fatal error ...
Jayson Meribe's user avatar
0 votes
1 answer
183 views

I'm trying to use libadwaita 1.1 in my Gtk-rs (GTK 4) application in order to access the new PreferenceGroup suffix feature introduced in 1.1. However, when I update my Cargo.toml to use libadwaita 0....
Ricky Kresslein's user avatar