Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    antoyo
    @antoyo
    @oofdog: mg is something like girara (https://pwmt.org/projects/girara/): it basically gives you vim-like functionality (key bindings, modes, commands, settings, …). Where does it say it's in alpha? mg is the library used by my web browser titanium. It's fairly stable, though I believe I introduce a bug in the last version.
    oofdog
    @oofdog
    oh ok my bad
    oofdog
    @oofdog
    hey
    he talks about relm. you may want to leave a comment about his opinion :P
    his code example is really basic https://github.com/davidedelpapa/rust-ui-relm
    oofdog
    @oofdog
    hey any examples on how to make a background transparent?
    antoyo
    @antoyo
    @oofdog: That would be more a GTK question. I believe you might have something special to do as it might also be controlled by the window manager.
    oofdog
    @oofdog
    its ok i figured it out, i can just use css
    Adib Saad
    @adibsaad
    Hi! Found this library about a week ago and have been playing around with it. Gotta say, it's pretty sweet
    antoyo
    @antoyo
    Thanks!
    Adib Saad
    @adibsaad
    One thing I'm struggling with is GTK documentation. Seems a bit old and it's hard to tell what parameters each widget type takes. Btw the examples in relm are very useful!
    antoyo
    @antoyo
    Yeah, learning GTK is the hard part ;) .
    Adib Saad
    @adibsaad
    Yup. This might be an easy question to you but how do you add a margin to a widget? I tried the margin_* properties but I think they're deprecated. I tried CSS but not luck either. Is it removed or something?
    Adib Saad
    @adibsaad
    Ah i see, we have to do it imperatively.
    antoyo
    @antoyo
    Well, no.
    The way relm works is by calling the set_* methods. Please read the tutorial: https://relm.antoyo.xyz/getting-started/
    Adib Saad
    @adibsaad
    ah ok. Actually figured out my issue. margin_bottom and margin_top work, but margin_left and margin_right don't work (on GtkGrid)
    You have to find the method in the gtk-rs doc for it to be available in relm.
    Adib Saad
    @adibsaad
    Ah yes that was it! My bad :P Still learning GTK
    oofdog
    @oofdog
    hey any examples on how to use infobar with relm?
    or do we have to do it the gtk-rs way?
    oofdog
    @oofdog
    hey so i figured out my issue regarding that
    but i ran into another issue
    so i have a gtkentry and i'm binding the input to a variable on the model
    text is bound to self.model.left_text and changed signal updates self.model.left_text
    however, when i run my code, which is the same, the program is unresponsive and my cpu is 100%
    gtkmain loop is stuck i think
    any idea why?
    it doesn't immediately freeze, but if enter and erase text and play around with it, it will eventually
    oofdog
    @oofdog
    i think the infinite loop is because it's calling set_text which triggers change signal which calls set_text, etc..
    antoyo
    @antoyo
    @oofdog: In order to prevent an infinite loop, you'll have to use a lock: https://github.com/antoyo/relm/blob/master/relm-examples/tests/checkboxes.rs#L80-L84
    oofdog
    @oofdog
    ok. does lock() work when you're seting the model like self.model.text_val = "something"; ?
    oofdog
    @oofdog
    on a related note, how does relm update bind model fields to widget variables? so when self.model.text_val = "something", how does relm call .set_text(...) on the entry?
    antoyo
    @antoyo
    @oofdog: The proc-macro will add the call to set_text() right after the assignation. So, the lock won't prevent that. It will prevent your relm Changed event to be emitted by the gtk changed signal when triggered by the call to set_text.
    oofdog
    @oofdog
    hey, so seeing as how gitter is moving to element (matrix), could be a good idea to move this channel there?
    antoyo
    @antoyo
    @oofdog: How is the gitter transition going to work? As far as I can tell, I have nothing to do and some day, gitter will just be a matrix server, right? Or, are you suggesting we move to matrix.org?
    oofdog
    @oofdog
    im actually not sure tbh
    oofdog
    @oofdog
    i suggested because the rust/gnome people are already on matrix
    antoyo
    @antoyo
    @oofdog: I started using Matrix very recently and I like it. I don't mind moving this to Matrix.
    oofdog
    @oofdog
    i'm down
    oofdog
    @oofdog
    alright, make a room and post the invite link here
    antoyo
    @antoyo
    Sure. I'll do that soon.
    antoyo
    @antoyo
    @oofdog: There it is: https://matrix.to/#/#relm:matrix.org?via=matrix.org . I'll soon update the description in gitter and the readme to redirect here.
    oofdog
    @oofdog
    awesome!
    Kookie
    @spacekookie:fairydust.space
    [m]
    I'm kinda new to relm and I'm trying to figure out if there is a way to propagate events upwards from a widget (so from a child to the container). I didn't see any mention of it in the docs or the examples. Is there something I've missed or is there another mechanism to do this?