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 ?
error[E0432]: unresolved import `gtk_sys`
--> src/lib.rs:9:5
|
9 | use gtk_sys as gtk;
| ^^^^^^^^^^^^^^ no `gtk_sys` in the root
error[E0432]: unresolved import `glib_sys`
--> src/lib.rs:10:5
|
10 | use glib_sys as glib;
| ^^^^^^^^^^^^^^^^ no `glib_sys` in the root
error[E0432]: unresolved import `gobject_sys`
--> src/lib.rs:11:5
|
11 | use gobject_sys as gobject;
| ^^^^^^^^^^^^^^^^^^^^^^ no `gobject_sys` in the root
error[E0432]: unresolved import `gio_sys`
--> src/lib.rs:12:5
|
12 | use gio_sys as gio;
| ^^^^^^^^^^^^^^ no `gio_sys` in the root
error[E0432]: unresolved import `atk_sys`
--> src/lib.rs:13:5
|
13 | use atk_sys as atk;
| ^^^^^^^^^^^^^^ no `atk_sys` in the root
error[E0432]: unresolved import `gdk_sys`
--> src/lib.rs:14:5
|
14 | use gdk_sys as gdk;
| ^^^^^^^^^^^^^^ no `gdk_sys` in the root
error[E0432]: unresolved import `pango_sys`
--> src/lib.rs:15:5
|
15 | use pango_sys as pango;
| ^^^^^^^^^^^^^^^^^^ no `pango_sys` in the root
error[E0432]: unresolved import `libc`
--> src/lib.rs:18:5
|
18 | use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
| ^^^^ maybe a missing crate `libc`?
Hello. I am trying to implement a grid with two columns containing image buttons. The columns are evenly distributed and I have vertical scrolling enabled. I want to load images into the buttons dynamically such that they are scaled to use the available width and the height implied by this width and the image's aspect ratio. They also shall be resized when their environment does. I tried to use the size_allocate signal but this is kind of unlegit as I request a larger height when already allocating. It also does not work, the button only resizes delayed when it gets its next update by window resizing or similar. So I tried to create a custom sublass to somehow be able to customize height for width and similar functions. But it seems like buttons currently are not subclassable.
Does anyone have an idea on how to solve this problem? I am trying to do so for two days...
ToggleButton->Alignment->Box->Image
which seems to be generated by button.set_image
. Outputting the allocations of all those widgets reveals that Box
and Image
have a small allocation (14x11) while the other ones have a much larger one (e.g. 377x301 for the Alignment
). I set h/v expand and h/v align to true/Fill for the Box
. The Box
also just has a single child. I do not understand why the Box
does not use the size of the Alignment
. Furthermore, I have problems trying more things with the Alignment
because it seems like it is not part of the language binding (it was in previous versions).
I was able to fix the problem by not using set_image
. Now I directly use add
to add a child to the button as a button also is a container.
According to its functionality, gtk::Alignment
likely is what caused my problems here as it seems to ignore other expand attributes. While it is flagged as deprecated (or at least all its member functions are), it is still used when setting the image for a button (where it is configured not to expand its content). I think that the reason why it was removed from gtk-rs is that it is deprecated but I could not find any further information about when and why it was removed. In my opinion it should be readded or potential problems caused by it should be documented for e.g. set_image
as it is still being used by gtk3. Currently, it adds potentially unwanted behaviour while gtk-rs provides no interface to influence this behaviour.
add()
. But get_children()
does not return those widgets as foreach()
and forall()
are not overridden while they are in the C tutorial. But ContainerImpl
does not allow me to override this? How can I fix this? Is there some special way of adding children I did not find in the documentation?
Hi Guys,
I'm trying to compile gtk4-rs with Cargo. I get a linker error:
note: /usr/bin/ld: /opt/gtk/lib/x86_64-linux-gnu/libgtk-4.so: undefined reference to `pango_fc_font_get_languages'
The /opt directory is where I have a freshly compiled gtk4. I am passing it to Cargo via this command:
CPPFLAGS="-I/opt/gtk/include" LDFLAGS="-L/opt/gtk/lib/x86_64-linux-gnu/" PKG_CONFIG_PATH="/opt/gtk/lib/x86_64-linux-gnu/pkgconfig" cargo build --release
Is there anything I can do to get past this error?
How do I load stock icon to an image? I am fighting with IconTheme and that does not seem to want to do it, hard to find any use of it... I need to flip UP and DOWN arrow on revealer... set_from_icon_name seems promising but does not want to load the stock images
There seems to be a binding missing for gtk-sys::gtk_image_set_from_stock
Type