Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 11 2015 14:08
    GuillaumeGomez commented #71
Timoūüö≥
@toger5:matrix.org
[m]
(From the matrix side at least)
Michael Ditto
@Miridyan
Hey, could someone give me some direction on generating new bindings for VTE3?
Im trying to update the bindings from https://github.com/antoyo/vte-rs to use the latest version of gtk-rs, but it just won't build once I change the version number in Cargo.toml and regenerating the bindings with Gir
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`?
All the libraries are in the Cargo.toml, but for some reason it doesn't see them?
I can clearly see gtk_sys and whatnot compiling from the cargo process, but then vte-sys-rs just fails with this error
Colby Eckert
@Tahlwyn
hi all. is it possible to align a Toolbar vertically along a screen edge? I know that Notebook has the really convenient set_tab_pos function that just takes a PositionType but Toolbar doesn't seem to have anything like that
garfreak
@garfreak

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...

garfreak
@garfreak
Seems like I actually achieved getting larger buttons by a custom container with a custom height for width function. But the image inside the button is too small. When I scale a pixbuf to 0.9 times the image allocation (did this for padding) it starts with a very small allocation (12x9) and gets smaller with each update until crashing due to scaling to a zero-width/height. I modified the allocation signal handler to get the allocations of the parent elements of the image. I have a hierarchy 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).
garfreak
@garfreak

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.

garfreak
@garfreak
How can I subclass the gtk::Container? I worked with the normal subclassing procedure and had this tutorial (http://ptomato.name/advanced-gtk-techniques/html/custom-container.html) in C as orientation on what to implement. I added a vector of widgets to my subclass to be filled by 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?
carmazine
@dearkarm

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?

carmazine
@dearkarm
I just checked /opt/gtk/include/pango-1.0/pango/pangofc-font.h and the function is defined there
Fabian Freyer
@fabianfreyer
Hi! Is this the right place to ask about glib/gobject and glib_wrapper!?
1 reply
zygon.sisyphus
@zygon.sisyphus:matrix.org
[m]
hi, is gtk-rs working with msys2 ?
4 replies
zygon.sisyphus
@zygon.sisyphus:matrix.org
[m]
thx
zygon.sisyphus
@zygon.sisyphus:matrix.org
[m]
is working
some examples
zygon.sisyphus
@zygon.sisyphus:matrix.org
[m]
laurent bernabé
@loloof64
Hi everyone ! Is there a way to use the recent version of librsvg ? Because I've seen that the rsvg crate is 3 year's old : no recent version has been released in crates.io
2 replies
laurent bernabé
@loloof64
Hi ! I've just seen that cairo-rs supports the svg feature. But, given I've got the svg bytes (with include_bytes!()), how can I draw them with a Context& ? I've been looking at the examples repository, but I did not find one.
Vypo
@Vypo
Has there been much work on gtk4 plus webkitgtk in rust yet?
Milan ҆ҕastn√Ĺ
@aknarts

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

Milan ҆ҕastn√Ĺ
@aknarts
No idea how to add it to the gir configuration... I wrote my own trait that does it and it works but it would be nice to be add it to upstream
Milan ҆ҕastn√Ĺ
@aknarts
Any idea if there is a "disconnect" after a connect_ is called?(I am reusing a button and the click triggers all previously connected presses)
Salem Yaslem
@xlmnxp_twitter
How I can open dialog with transient without block the thread?
Timo
@toger5:matrix.org
[m]
How can i get access the glib Type
I am trying to get my ListStore object working. It needs a type for the column
varomix
@varomix
hi, is the GDL available from rust? I'm looking to do something like this example in Rust https://wiki.gnome.org/Projects/Vala/GdlSample thank you
Dziban.dev
@Dziban-dev
is there a GTK4 room?
Dziban.dev
@Dziban-dev
anyone knows the difference between 'app.connect_startup(move |app| {build_ui(app);});' and
'app.connect_activate(build_ui);' does it matter witch one i use