IRC channel logs

2020-04-22.log

back to list of logs

***wxie1 is now known as wxie
***catonano_ is now known as catonano
<str1ngs>dsmith-work: it's worth it. this helped me when switched to paredit. http://danmidwood.com/content/2014/11/21/animated-paredit.html
<tohoyn>I can't obtain the info structure for procedure gtk-container-child-get-property. I have tried e.g. (g-irepository-find-by-name "Gtk" "gtk-container-child-get-property"). Can you help me with this?
<tohoyn>when I try describe with <gtk-container> the function child-get-property is not present in the method list.
<daviid> tohoyn: the secod agument should be a name as expected by GI, camelcase, no underscore ... they are the exact same name(s) you seu for gi-import-by-name ... try to see f you can find it ..
<str1ngs>tohoyn: (describe (gi-cache-ref 'function 'gtk-container-child-get-property)) works for me.
<daviid>tohoyn: yu may also use accessors, for g-object instance properties
<tohoyn>gi-cache-ref works. thanks.
<daviid>tohoyn: wrt to these functions that are not in GI, because varargs, we should offer, gradually, a manual wrap/binding, I'm still thinking on the best way to acheive this, which is not as obvious as it seems, because in g-golf, we may (and even promote) selective imports ...
<tohoyn>daviid: AFAIK varargs are not (or were not) very well implemented in C++. Can you pass objects as a variable argument?
<daviid>tohoyn: varags function are not in any GI typelib that I am aware of - nothing to do ith C++ - then I don't understand the last question, can you give an example
<daviid>tohoyn: gtk-list-store-new isn't in "Gtk" "ListStore" either, just to gve another example ...
<daviid>and fwiw has been manually wrapped in guile-gnome as well
<str1ngs>(make <gtk-list-store>) should work though?
<daviid>definitely
<str1ngs>there I are very few cases to use -new I found
<daviid>but yesteray i spoted a bug/limitation that i'd lie to work on today:
<daviid>str1ngs: good for you, the more you goopsify your code the better, imo
<daviid>i can't wait to have short method nams, these long names are a pita :):)
<daviid>but one thing at a time
<str1ngs>short methods names would be handly, but the longs names don't hurt either.
<str1ngs>handy*
<daviid>long names make th code pretty unreadable, i think, but i guess it's personal ...
<daviid>this workd fie as well tohoyn (make <gtk-tree-view-column> #:title "Column 1")
<str1ngs>I prefer the short names. but I'm use to GTK C code haha
<daviid>which saves a call and is 10 times more readable :):)
<str1ngs>what I need to figure out. not an issue with g-golf but how to make my derived classes more flexible
<daviid>however, this fails: (make <gtk-tree-view> #:model $5) - where $5 would be a list-stre -| sscm-error"Not implemented:"interface ... I am gona work on this I hope to solve the problem soon ...
<daviid>
<str1ngs>or maybe not use derived classes at all and just use constructor functions
<daviid>str1ngs: what you mean more flexible?
<daviid>tohoyn: fyi this works fine (gtk-tree-path-new-from-string "0")
<daviid>(gtk-tree-model-get-iter a-store the-above-call-result-pointer)
<str1ngs>hard to explain, I guess I want my class to be more generic. but I always seem to hit edge case
<str1ngs>daviid: for context with nomad's mode-line and echo area . they are derived from the same class. one is backed by a emacsy buffer the other is back by a thunk.
<daviid>tohoyn: these functions returns two values, but you can and should add their name to %gi-strip-boolean-result - and read if you ddid not yet, the manual exaplining what this is ...
<daviid>str1ngs: design is certainly the most difficult task, as is naming variables .. :):)
<str1ngs>daviid: aye, I'm just thinking out loud :) . I think I need to redesign them anyways. at least they are event driven unlike emacs :)
<str1ngs>they only get updated when they need to :)
<tohoyn>function gtk-container-child-get-property expects a GValue as its last argument and stores the property value there. What should I pass in that argument?
<tohoyn>it's not an output argument
<daviid>tohoyn: maybe it needs an override, let me check
<daviid>can't you access the property using its accessor?
<tohoyn>daviid: I'll try
<tohoyn>daviid: it works
<daviid>can you paste a tiny example, i'll try to override this function then ...
<tohoyn>I have some problems with the PasteZone. It keeps saying "do not spam"
<tohoyn>daviid: I'll send you email
<daviid>tohoyn: you may use gnome pste as well
<tohoyn>daviid: ok
<daviid>yes, debian allws a few paste per day, dont know exactly how many ...
<tohoyn>daviid: see https://paste.gnome.org/p2atiu4ks
<daviid>ok tx, wil look asap, but i'm on something else 'right now'
<tohoyn>daviid: do the accessor work for child properties? did not work for me.
<tohoyn>str1ngs: do you know about this?
<daviid>but you may call the accessor on the child instance right?
<daviid>(!scale-factor hbox) maybe
<daviid>i didn't try yet
<tohoyn>daviid: it seems that the child accessors are not even defined
<tohoyn>daviid: try e.g. !resize
<daviid>what call exactly, so i can (later) try ...
<tohoyn>daviid: see https://paste.gnome.org/pe4hxkgka
<str1ngs>gtk_container_child_get_property is not the best function. it uses a mutator
<str1ngs>which is okay when you are using C. but for this I would just use an accessor as daviid mentioned
<tohoyn>child properties are properties related to the relation between the container and the child. that's why they don't have accessors (AFAIK).
<str1ngs>let me clean this example up. and play with it somemore
<str1ngs>daviid: GValue is not implemented right?
<tohoyn>IMHO the last argument of gtk-container-child-get-property should be an output argument.
<str1ngs>tohoyn: here's a work around https://paste.gnome.org/pwaig3qq7
<str1ngs>I used a mutator to but there is probably a better way to reduce the list
<str1ngs>it's a bit hacky
<tohoyn>str1ngs: tx
<str1ngs>tohoyn: version that avoids using set!
<str1ngs> https://paste.gnome.org/pzflc9uly
<str1ngs>this might be to functional but the find with gtk-container-get-children is just as effective as gtk-container-child-get-property
***apteryx_ is now known as apteryx
<tohoyn>str1ngs: yes but all child properties don't have corresponding ordinary properties (e.g. shrink)
<str1ngs>right but you would have to account for that anyways. does GValue become false in those case or something?
<str1ngs>I understand you are probably using this in a introspective way so it might not be so ideal.
<tohoyn>str1ings: it is used in a Theme-D-Gnome UI demo (not introspective)
<tohoyn>str1ngs: I can paste you the code
<str1ngs>that might give me some context
<tohoyn>str1ngs: see https://paste.gnome.org/plqbrcdyp
<tohoyn>str1ngs: note that the code is in Theme-D
<str1ngs>gotcha, can D use goops?
<tohoyn>str1ngs: T-D has an object system resembling GOOPS somewhat
<tohoyn>str1ngs: the code uses Theme-D-Gnome which works on top of guile-gnome
<tohoyn>Theme-D can access GOOPS classes
<tohoyn>in the target platform
<tohoyn>str1ngs: see http://www.tohoyn.fi/theme-d/index.html and http://www.tohoyn.fi/theme-d-gnome/index.html
<str1ngs>this is interesting :)
<str1ngs>I think though for now until there are GValues you might have to loop to get a property
<tohoyn>ok
<str1ngs>I find though I do'nt have to do this. beause I just create slots for children I need to access
<str1ngs>there are times where dynamically finding children is handy though.
<tohoyn>the problem is that there are not ordinary properties corresponding all child properties
<str1ngs>right, but in most cases you know the class you are dealing with.
<str1ngs>trying to think if a type system would make this harder ..
<daviid>tohoyn: note that gtk-hbox-new is deprecated, you should use gtk-box-new i think
<tohoyn>daviid: ok
<daviid>I can't find the definitionof the scale-factor propoerty
<str1ngs>tohoyn or you can do (when (is-a? widget <gtk-window>) (!title window))
<str1ngs>daviid: https://developer.gnome.org/gtk3/unstable/GtkWidget.html#GtkWidget--scale-factor
<str1ngs>its a <gtk-widget> property
<str1ngs>daviid: that's unstable just FYI meant to link the stable one
<daviid>it's ok i got it tx
<daviid>tohoyn: so, in the mean time, you may call (gtk-widget-get-scale-factor hbox) of course ...
<daviid>str1ngs: g-value's are definitely implemented ans used everywhere in g-golf, like g-closure's in general, signals i particular, yet to come callbacks ... everywhere - there are also functions that expect Gvalue as argument(s), like gtk-list-store-set-value, gtk-tree-model-get-value, and this gtk-container-child-get-property
<daviid>tohoyn: for info, gtk-container-child-get-property last argument is 'in, not out
<str1ngs>daviid: ya how this would work in C is you would do GValue x; then you g_value_init . and then pass x as the last value. and it gets mutated
<str1ngs>it's like how GError works as well
<str1ngs>actually you would past the reference with &x
<daviid>tohoyn: it sys "scale-factor" is not a child property of ...
<tohoyn>daviid: resize and shrink are child properties
<daviid>not of window
<daviid>tohoyn: to test, i need an example that 'works' bcuse i need to look in the doc, find the type, ...
<daviid> (gtk-container-child-get-property window hbox "scale-factor" ...) is incorrect
<daviid>so is incorrect shrink ..
<daviid>do you have a working C example?
<tohoyn>daviid: no
<tohoyn>daviid: I do have a Scheme example using guile-gnome
<str1ngs>daviid: gtk-container-child-get-property finds the property of hbox
<daviid>can you writ that in g-golf then
<daviid>that call
<str1ngs>it won't work because you need to pass a gvalue
<daviid>str1ngs: hold on
<daviid>let me handle this
<str1ngs>and there is no way to create a GValue as far as I know.
<daviid>i need a plausible call
<tohoyn> (gtk-container-child-get-property window-main hbox "scale-factor" x)
<daviid> (gtk-container-child-get-property window hbox "scale-factor" ...) is incorrect
<str1ngs> https://paste.gnome.org/pzflc9uly does the same thing
<str1ngs>^ more scheme like IMHO
<daviid>tohoyn: you don't understand, scale-factor is not a chld property for gtkwindow
<tohoyn>daviid: forget scale-factor. The problems are resize and shrink
<daviid>resize and shrink are not either ...
<tohoyn>daviid: ???
<daviid>i thnk you dont understand how this work, if i may say so ...
<tohoyn>daviid: see https://developer.gnome.org/gtk3/stable/GtkPaned.html#GtkPaned.child-properties
<daviid>(guile:106981): Gtk-WARNING **: 04:54:03.433: ../../../../gtk/gtkcontainer.c:1264: container class 'GtkWindow' has no child property named 'shrink'
<daviid>
<tohoyn>daviid: do you use GTK2?
<daviid>yes, so the call should ass an hbox and a chld ..
<daviid>not a gtkwindow and an hbox ...
<tohoyn>daviid: resize and shrink are child propertied of GtkPaned
<daviid>tight, not of gtkwindow
<daviid>the call you pasted is incorrect
<tohoyn>daviid: yes
<daviid>so, please paste a correct example i can try, forget about g-value, i'll handle it, i ned a proper example of a 'working' child property
<daviid>thos you pasted are all incorrect
<tohoyn>daviid: see https://paste.gnome.org/pw6qms3mt
<tohoyn>daviid: sorry for the incorrect code
<daviid>ok let me try
<daviid>tx
<daviid>i don't want to imprt the all gtk namespace, what is the name of the info to get hpand/vpaned procs, here (gi-import-by-name "Gtk" "Paned") is insufficient it appears
<tohoyn>daviid: wait ...
<tohoyn>daviid: for me it is enough
<daviid>i fund it
<tohoyn>daviid: gtk-container-child-get-property is defined
<daviid>it is (gi-import-by-name "Gtk" "HPaned"), i missspelled it imn my previous call ...
<str1ngs>tohoyn: which property of hbox did you want?
<tohoyn>str1ngs: resize and shrink (child properties)
<str1ngs>what type is resize bool?
<tohoyn>str1ngs: both are boolean
<str1ngs>I'm just putting a C example together
<str1ngs>thanks
<str1ngs>(guile-2.2:436367): Gtk-WARNING **: 01:11:21.671: ../../../../gtk/gtkcontainer.c:1264: container class 'GtkWindow' has no child property named 'resize'
<tohoyn>str1ngs: try to add a gtk-paned object into another gtk-paned
<daviid>tohoyn: ok, here is what I wnted to test so I could give you the proper feedback,
<str1ngs>as daviid pointed out this only works if there are child properties like paned
<tohoyn>str1ngs: see https://paste.gnome.org/pw6qms3mt
<daviid>the last argument of gtk-containerchild-get-property is a pointer to a g-vlue, that _must_ be initialized, that is it can _not_ be an empty g-value
<daviid>here is what works - https://paste.gnome.org/p7trju0x3
<tohoyn>daviid: tx!
<daviid>welcome - please also note in this example, scrpts must import goops _before_ the defaut-duplicate-binding-handler call, then you import g-golf and selectively import the rest ...
<daviid>tohoyn: so, you must know the child property type before to b make these call
<daviid>tohoyn: str1ngs I want to patch g-value-init so it accept the symbol or the g-type, so we can short calls in our caode .... it was not ment to be called when i desned it lng ago ... will do this now! :):)
<daviid>tohoyn: also, while debugging g-golf, I prefer scripts asjust pasted, in pace of those using <gtk-application>, please keep it as a way to work with me .. thanks!
<daviid>*in place of ... it uses <gtk-window> and gtk-main ... unless the test is about <gtk-application> <g-application> of course ...
<daviid>tohoyn: str1ngs if/when the function you call accept an empty (pointer to) a GValue, use (g-value-new)
<tohoyn>daviid: how do I get the boolean value out of GValue?
<daviid>for 'in 'inout args of course, you ahould never pass 'out args (i know you know, but just reminding ...
<daviid>always use (g-value-ref g-vlue), it knows its type ...
<tohoyn>daviid: tx
<daviid>tohoyn: you ca see that in the example i pasted
<daviid>line 47
<daviid>tohoyn: dimfi is 'my version' of peek/pk, it is in (g-golf support utils) fwiw
<str1ngs>daviid: here's a working C example https://paste.gnome.org/pd9p9hk7l
<daviid>used only to debug
<str1ngs>is there a g-value-new?
<daviid>ys
<daviid>i just wrote it above :)
<daviid>wrote about it here above :)
<str1ngs>i've never heard of g-value-new before
<daviid>str1ngs: I know how to do these things in C, but thanks for the example - it's amazing how much more beautifull things are i scheme ... :)
<str1ngs>nothing wrong with C :P
<daviid>str1ngs: g-value-new is new :), introduced a couple of patches ago i think
<str1ngs>well I better git pull. that would explain alot lol
<daviid>str1ngs: i need to add it to the manual
<daviid>will do that now to
<str1ngs>I think maybe (g-value-new 'int) would be better?
<str1ngs>or more like <g-int> dunno if that is actually a class though
<str1ngs>main things would be 'int 'string 'boolean etc
<str1ngs>but let me see if g_init works
<str1ngs>g-value-init I mean
<daviid>no, because we need both, and g-value-init is the scheme call for g_value_init ...
<str1ngs>tha't fine as long as (g-value-init) works but it only takes one argument which is odd
<str1ngs>should be more like (g-value-init x <g-string>) maybe?
<str1ngs>daviid: gtk-init is be deprecated so it's kinda hard to keep pushing that :)
<str1ngs>unless we can come up with a simple main loop
<daviid>str1ngs: for debugging g-golf, i prefer scrits as I wrote above, unlss it is to debug <g-application> <gtk-application> calls ...
<daviid>gtk-mai is the simple loop
<daviid>*gtk-main
<str1ngs>the problem will be though is gtk-init is going to be deprecated completely eventually. and it's not what GTK teaches anymore
<daviid>as I said, to debug g-golf ...
<str1ngs>I'm just giving you a heads up, you can't expect people to use gtk-init when it's functionality is heading out the door. things change.
<str1ngs>but I should get some sleep.
<str1ngs>good night
<daviid>good night
<daviid>tohoyn: i just pushed a patch so now you may also call g-value-init passing a symbol, which then must be a %g-type-fundamental-types
<daviid>tohoyn: in the example we used, you may replace the call by (g-value-init 'boolean)
<tohoyn>daviid: ok
<dsmith-work>UGT Greetings, Guilers
<RhodiumToad>yo
<dsmith-work>str1ngs: Nice!
<dsmith-work>str1ngs: I have muscle memory for C-right and C-left to move by words. That's bound to slurping and barfing.
***wxie1 is now known as wxie
***wxie1 is now known as wxie
***wxie1 is now known as wxie
***wxie1 is now known as wxie
<tohoyn>When I try to change the font of the text in a text buffer I get crap onto the screen. See https://paste.gnome.org/poaxcmiub to reproduce the bug.
<tohoyn>If I don't apply the tag the code works fine.
<tohoyn>Can somebody help me with this?
<tohoyn>The code uses G-Golf
***rekado_ is now known as rekado
<zzappie>Hello guilers!
<zzappie>Any one knows of fuse guile library?
<dsmith-work>Nope. But a simple gsearch revealed this: https://github.com/sph-mn/guile-fuse
<str1ngs>dsmith: slurping and barfing is so handy. from some reason it's one of the last things I decided to learn lol
<str1ngs>for*
<str1ngs>tohoyn: I'll take a look in a second
<str1ngs>tohoyn: it shows file contents for me here.
<str1ngs>tohoyn: I did notice you have two (iter (gtk-text-buffer-get-start-iter textbuffer)) and only one is useful here.
<str1ngs>plus one shadows the other. I'm not sure how guile handles those situation or if that might be the cause.
<zzappie>dsmith-work: Hey thanks ive found it too and was stuck exploring this person's profile for about an hour he or she did lots of cool stuff
<tohoyn>str1ngs: I get squares with hexadecimal numbers. removing the first get-start-iter didn't help.
<tohoyn>str1ngs: the upper parts of the hexadecimal numbers are zeros
<dsmith-work>Just guessing, that might be a locale thing?
<tohoyn>see https://pasteboard.co/J50Chx9.png for the output
<tohoyn>dsmith-work: possible
<tohoyn>str1ngs: what locale are you using?
<tohoyn>dsmith-work: setting LANG=C didn't help
<dsmith-work>Or maybe what fonts are installed?
<dsmith-work>Aren't those hex boxes because <whatever> couldn't find the right thing to be displayed for that character?
<tohoyn>dsmith-work: it is the fonts
<tohoyn>dsmith-work: font "Sans 18" works fine
<tohoyn>dsmith-work: tx
<tohoyn>Courier 18 doesn't work either
<tohoyn>it would be nice to have Courier fonts
<stis>hi guilers!
<sneek>Welcome back stis, you have 1 message!
<sneek>stis, manumanumanu says: Could you help me port 3 seemingly simple syntax-parse things from racket? I am porting parsack to guile, and that is about the only thing left
<stis>manumanumanu: shoot!
<str1ngs>tohoyn: I'm using en_US.UTF-8
<str1ngs>tohoyn: though it's probably a missing font I would think?
<tohoyn>str1ngs: probably
<tohoyn>I'm going sleeping.
<dsmith-work>sneek: botsnack
<sneek>:)
<dsmith-work>sneek: bugs?
<sneek>Someone once said bugs is Send reports to bug-guile@gnu.org, and see bug reports at https://bugs.gnu.org/guile
<dsmith-work>sneek: gnucash?
<sneek>Last time I checked gnucash is amazing
<dsmith-work>sneek: where is guile-software?
<sneek>guile-software is at http://sph.mn/foreign/guile-software.html
<dsmith-work>sneek: where is guile-software?
<dsmith-work>sneek: where is guile-software?
<sneek>Someone once said guile-software is at http://sph.mn/foreign/guile-software.html
<dsmith-work>sneek: seen rlb?
<sneek>rlb was here 4 days ago, saying: OK, finally have 3.0.2 in debian and "settled" such that it should be able to propagate to testing (hadn't noticed some issues that had prevented propagation of 3.0 in general up to now)..
***selimcan-i_sani is now known as selimcan
<dsmith-work>sneek: later tell glorx some message
<sneek>Okay.
***dsmith-work is now known as glorx
<glorx>Hey
<sneek>Welcome back glorx, you have 1 message!
<sneek>glorx, dsmith-work says: some message
***glorx is now known as dsmith-work
<dsmith-work>sneek: botsnack
<sneek>:)
<dsmith-work>sneek: botsnack
<sneek>:)
<dsmith-work>sneek: seen rlb?
<sneek>rlb was here 4 days ago, saying: OK, finally have 3.0.2 in debian and "settled" such that it should be able to propagate to testing (hadn't noticed some issues that had prevented propagation of 3.0 in general up to now)..
<dsmith-work>sneek: where is guile-software?
<sneek>Someone once said guile-software is at http://sph.mn/foreign/guile-software.html
<dsmith-work>sneek: help
<dsmith-work>sneek: seen rlb?
<sneek>rlb was here 4 days ago, saying: OK, finally have 3.0.2 in debian and "settled" such that it should be able to propagate to testing (hadn't noticed some issues that had prevented propagation of 3.0 in general up to now)..
<dsmith-work>sneek: botsnack
<sneek>:)
<dsmith-work>sneek: where is guile-software?
<sneek>Someone once said guile-software is at http://sph.mn/foreign/guile-software.html
<dsmith-work>Hmm. Seem to be working nicely
<rndd>hi everyone! newbe question alert! suppose i want to use a library written in guile. can i just load it as local files instead of placing source code inside guile directory?
<mwette>set GUILE_LOAD_PATH to point to directory where the files are.
<mwette>or guile -L path/to/files