alex285
through*
ScrolledWindow
with a FlowBox
(+ parent Viewport
, etc)ListStore
GtkGridView
looks like it's exactly what I need right now... 🤤 But that's gtk4 only, and as far as I can tell, gtk-rs/{gtk4, gir} aren't there, yet, IIUCHello everyone ! I am trying to use the clone macro for a closure. But it seems I can't use for fields access :
fn build_widget(state: &ChessBoardState) -> DrawingArea {
let area = DrawingArea::new();
let size = state.size;
area.set_size_request(size, size);
area.connect_draw(clone!(@weak state => |_source, context| {
let (bg_red, bg_green, bg_blue) = state.background_color;
context.set_source_rgb(bg_red, bg_green, bg_blue);
context.paint();
Inhibit(false)
}));
area
}
I got Variables need to be valid identifiers, e.g. field accesses are not allowed as is, you must rename it!
. So using state
variable as is is not possible, so is there a workaround ?
adjivas
Hello, the gtk4 examples are always buildable? I'm not sure which rust's version to use. https://github.com/gtk-rs/examples4
I tried grabbing a pixbuf of my screen, but I fail to retrieve the window surface using "offscreen_window_get_surface".
Are there any other API endpoints to grab the surface of the root window, or am I missing something?
Here's the code: https://gist.github.com/eHammarstrom/cf465d20690368dc1f5f9a7aaa482ff1
Hey guys, I would like to draw nodes and lines between those nodes. These graphs will be used to simulate algorithms on them. At which structs should I take a look?
My use case is:
gondolyr
Hey everyone, I'm looking to start a project with libhandy but when I go to build, I get failed to add UI: .:7:1 Invalid object type 'HdyApplicationWindow'
. I've installed libgtk-3-dev
and libhandy-0.0-0
, though I'd like to use libhandy-1
when it's available from the Debian repository. Also, if anyone has a handy tutorial, I'd appreciate that as well.
mmstick
> <@vancha112:matrix.org> hey everyone ^^ I'm looking to increase the size of my text in gtk-rs. I knew that gtk could make use of css for increasing for example text size, but I don't know how to do so in gtk-rs :(
You could use CSS, but pango also works for modifying text attributes.
use gtk::prelude::*;
fn main() {
if let Err(msg) = gtk::init() {
println!("Failed to initialize GTK: '{}'", msg);
return;
}
let layout_src = include_str!("../res/gui_layout.glade");
let builder = gtk::Builder::from_string(layout_src);
let window: gtk::Window = builder.get_object("window").unwrap();
window.show_all();
gtk::main();
}
mmstick
It won't do anything here since gtk::main_quit()
will quit the application
Timo
Is it broken atm?
Timo
gtk-rs/examples4#8
Timo
That us the error message:error: failed to select a version for `gsk4-sys`.
... required by package `gtk4 v0.1.0 (https://github.com/gtk-rs/gtk4#8aeb9dce)`
... which is depended on by `gtk-rs-examples4 v0.0.1 (/home/timo/Programming/RustExperiments/examples4)`
versions that meet the requirements `*` are: 0.1.0
the package `gsk4-sys` links to the native library `gtk-4`, but it conflicts with a previous package which links to `gtk-4` as well:
package `gdk4-sys v0.1.0 (https://github.com/gtk-rs/sys#dbd887f1)`
... which is depended on by `gdk4 v0.1.0 (https://github.com/gtk-rs/gdk4#bf87233c)`
... which is depended on by `gtk-rs-examples4 v0.0.1 (/home/timo/Programming/RustExperiments/examples4)`
failed to select a version for `gsk4-sys` which could resolve this conflict
Timo
* That is the error message:error: failed to select a version for `gsk4-sys`.
... required by package `gtk4 v0.1.0 (https://github.com/gtk-rs/gtk4#8aeb9dce)`
... which is depended on by `gtk-rs-examples4 v0.0.1 (/home/timo/Programming/RustExperiments/examples4)`
versions that meet the requirements `*` are: 0.1.0
the package `gsk4-sys` links to the native library `gtk-4`, but it conflicts with a previous package which links to `gtk-4` as well:
package `gdk4-sys v0.1.0 (https://github.com/gtk-rs/sys#dbd887f1)`
... which is depended on by `gdk4 v0.1.0 (https://github.com/gtk-rs/gdk4#bf87233c)`
... which is depended on by `gtk-rs-examples4 v0.0.1 (/home/timo/Programming/RustExperiments/examples4)`
failed to select a version for `gsk4-sys` which could resolve this conflict
felinira
What is the difference between https://github.com/gtk-rs/gtk-rs/tree/master/glib and https://github.com/gtk-rs/glib ?