Re: fill in form
Is this not anything like what you're after? https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.w3.org%2FTR%2F2016%2FCR-css-grid-1-20160929%2Fimages%2Fauto-placed-form.png&f=1&nofb=1 Kind Regards - Timo On 12/05/2020 20:44, ToddAndMargo via perl6-users wrote: > > On 12/05/2020 00:47, ToddAndMargo via perl6-users wrote: > >> Hi All, > >> > >> I want to create a fill in form in Windows: city, > >> state, etc., you fill in the data. > >> > >> Is there some library out there for that? > >> > >> Any words of wisdom? > >> > >> Many thanks, > >> -T > > > On 2020-05-12 08:18, Timo Paulssen wrote: >> Hi Todd, >> >> normally I'd expect you want to create a grid with labels on the left >> and text inputs on the right. >> >> the examples/ folder in the GTK::Simple distribution (or the source on >> github) has an example of the Grid class, which is very powerful. >> >> The grid is possibly more complicated than you need it to be; instead >> you can probably have one VBox that contains one HBox for every label + >> input field. >> >> One benefit that the Grid will give you is that you can much more easily >> line up all the fill-in text inputs, whereas with a VBox of HBoxes it >> may just make every text input as wide as possible so it (almost) >> touches the end of the label, so different words ("city" vs "first >> name") could result in different-sized text inputs. >> >> hope that helps >> - Timo >> > > > Hi Timo, > > You mean this one? > > https://github.com/raku-community-modules/gtk-simple/blob/master/examples/03-grid.pl6 > > > https://ibb.co/hgKHgW4 > > I do not see the utility of what I am after. > > :'( > > -T
Re: fill in form
> On 12/05/2020 20:44, ToddAndMargo via perl6-users wrote: >>> On 12/05/2020 00:47, ToddAndMargo via perl6-users wrote: Hi All, I want to create a fill in form in Windows: city, state, etc., you fill in the data. Is there some library out there for that? Any words of wisdom? Many thanks, -T >> >> >> On 2020-05-12 08:18, Timo Paulssen wrote: >>> Hi Todd, >>> >>> normally I'd expect you want to create a grid with labels on the left >>> and text inputs on the right. >>> >>> the examples/ folder in the GTK::Simple distribution (or the source on >>> github) has an example of the Grid class, which is very powerful. >>> >>> The grid is possibly more complicated than you need it to be; instead >>> you can probably have one VBox that contains one HBox for every label + >>> input field. >>> >>> One benefit that the Grid will give you is that you can much more easily >>> line up all the fill-in text inputs, whereas with a VBox of HBoxes it >>> may just make every text input as wide as possible so it (almost) >>> touches the end of the label, so different words ("city" vs "first >>> name") could result in different-sized text inputs. >>> >>> hope that helps >>> - Timo >>> >> >> >> Hi Timo, >> >> You mean this one? >> >> https://github.com/raku-community-modules/gtk-simple/blob/master/examples/03-grid.pl6 >> >> >> https://ibb.co/hgKHgW4 >> >> I do not see the utility of what I am after. >> >> :'( >> >> -T On 2020-05-13 05:26, Timo Paulssen wrote: Is this not anything like what you're after? https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.w3.org%2FTR%2F2016%2FCR-css-grid-1-20160929%2Fimages%2Fauto-placed-form.png&f=1&nofb=1 Kind Regards - Timo Yes!
slurp with enc("utf16") doesn't work
I just got to look into this one again a little further, and it does seem that reading a utf16 file like this doesn't work: my $contents = slurp( $file, :enc("utf16") ); Though this, however, does work: my $fh = $file.IO.open( :r, :enc("utf16") ); my $contents = $fh.slurp; Also the routine form (as opposed to the method form) of slurp works with other encodings like utf8 and latin1. So I'm opening an issue for this on github: https://github.com/rakudo/rakudo/issues/3691
Re: fill in form
On Wed, May 13, 2020 at 07:58:08AM -0700, Todd Chester via perl6-users wrote: > > On 12/05/2020 20:44, ToddAndMargo via perl6-users wrote: > >>> On 12/05/2020 00:47, ToddAndMargo via perl6-users wrote: > Hi All, > > I want to create a fill in form in Windows: city, > state, etc., you fill in the data. > > Is there some library out there for that? > > Any words of wisdom? > > Many thanks, > -T > >> > >> > >> On 2020-05-12 08:18, Timo Paulssen wrote: > >>> Hi Todd, > >>> > >>> normally I'd expect you want to create a grid with labels on the left > >>> and text inputs on the right. > >>> > >>> the examples/ folder in the GTK::Simple distribution (or the source on > >>> github) has an example of the Grid class, which is very powerful. > >>> > >>> The grid is possibly more complicated than you need it to be; instead > >>> you can probably have one VBox that contains one HBox for every label + > >>> input field. > >>> > >>> One benefit that the Grid will give you is that you can much more easily > >>> line up all the fill-in text inputs, whereas with a VBox of HBoxes it > >>> may just make every text input as wide as possible so it (almost) > >>> touches the end of the label, so different words ("city" vs "first > >>> name") could result in different-sized text inputs. > >>> > >>> hope that helps > >>> - Timo > >>> > >> > >> > >> Hi Timo, > >> > >> You mean this one? > >> > >> https://github.com/raku-community-modules/gtk-simple/blob/master/examples/03-grid.pl6 > >> > >> > >> https://ibb.co/hgKHgW4 > >> > >> I do not see the utility of what I am after. > >> > >> :'( > >> > >> -T > > On 2020-05-13 05:26, Timo Paulssen wrote: > > Is this not anything like what you're after? > > > > https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.w3.org%2FTR%2F2016%2FCR-css-grid-1-20160929%2Fimages%2Fauto-placed-form.png&f=1&nofb=1 > > > > Kind Regards > > - Timo > > > > Yes! So... I believe Timo gave you that as an example how to use a grid to position the various controls (buttons, text labels, input fields). You start there, you figure out what text labels, what input fields, what buttons you need, and then you use the 03-grid.p6 example as a base on how to do this with Raku and GTK+. G'luck, Peter -- Peter Pentchev r...@ringlet.net r...@debian.org p...@storpool.com PGP key:http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13 signature.asc Description: PGP signature
Re: fill in form
On 2020-05-13 14:05, Peter Pentchev wrote: On Wed, May 13, 2020 at 07:58:08AM -0700, Todd Chester via perl6-users wrote: On 12/05/2020 20:44, ToddAndMargo via perl6-users wrote: On 12/05/2020 00:47, ToddAndMargo via perl6-users wrote: Hi All, I want to create a fill in form in Windows: city, state, etc., you fill in the data. Is there some library out there for that? Any words of wisdom? Many thanks, -T On 2020-05-12 08:18, Timo Paulssen wrote: Hi Todd, normally I'd expect you want to create a grid with labels on the left and text inputs on the right. the examples/ folder in the GTK::Simple distribution (or the source on github) has an example of the Grid class, which is very powerful. The grid is possibly more complicated than you need it to be; instead you can probably have one VBox that contains one HBox for every label + input field. One benefit that the Grid will give you is that you can much more easily line up all the fill-in text inputs, whereas with a VBox of HBoxes it may just make every text input as wide as possible so it (almost) touches the end of the label, so different words ("city" vs "first name") could result in different-sized text inputs. hope that helps - Timo Hi Timo, You mean this one? https://github.com/raku-community-modules/gtk-simple/blob/master/examples/03-grid.pl6 https://ibb.co/hgKHgW4 I do not see the utility of what I am after. :'( -T On 2020-05-13 05:26, Timo Paulssen wrote: Is this not anything like what you're after? https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.w3.org%2FTR%2F2016%2FCR-css-grid-1-20160929%2Fimages%2Fauto-placed-form.png&f=1&nofb=1 Kind Regards - Timo Yes! So... I believe Timo gave you that as an example how to use a grid to position the various controls (buttons, text labels, input fields). You start there, you figure out what text labels, what input fields, what buttons you need, and then you use the 03-grid.p6 example as a base on how to do this with Raku and GTK+. G'luck, Peter You would not happen to have a guide for the complete idiot? Maybe an example too? 03-grid.p6 does not show how to extract the information. Can I do all this with glade? https://glade.gnome.org/ It has a nice tutorial.
Re: fill in form
On 2020-05-13 15:29, ToddAndMargo via perl6-users wrote: 03-grid.p6 does not show how to extract the information. But he does make this comment: Once again we're free to directly define and assign a variable to hold the widget for later on. Which totally blows my mind.
bash "."?
Hi All, Do we have anything like Bash's "." statement where we can read in a bunch of values from a .cfg file? (I think it is called "include", but I am not sure.) . /etc/sysconfig/network-scripts/ifcfg-br0 which populates these (and other) variables DEVICE=br0 TYPE=Bridge ONBOOT=yes USERCTL=yes DELAY=0 NM_CONTROLLED=yes BOOTPROTO=none PREFIX=24 ... Many thanks, -T
Re: bash "."?
I didn't understand well your question, but "." in bash usually means "the local directory". On Wed, May 13, 2020 at 11:37 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > Do we have anything like Bash's "." statement where > we can read in a bunch of values from a .cfg file? > (I think it is called "include", but I am not sure.) > > . /etc/sysconfig/network-scripts/ifcfg-br0 > > which populates these (and other) variables > > DEVICE=br0 > TYPE=Bridge > ONBOOT=yes > USERCTL=yes > DELAY=0 > NM_CONTROLLED=yes > BOOTPROTO=none > PREFIX=24 > ... > > Many thanks, > -T > -- Aureliano Guedes skype: aureliano.guedes contato: (11) 94292-6110 whatsapp +5511942926110
Re: bash "."?
Aureliano Guedes writes: I didn't understand well your question, but "." in bash usually means "the local directory". In this instance, Todd is referring to the "." shell builtin, which reads shell commands from a file and executes them. Alexis.
Re: bash "."?
> On May 13, 2020, at 9:37 PM, ToddAndMargo via perl6-users > wrote: > > Hi All, > > Do we have anything like Bash's "." statement where > we can read in a bunch of values from a .cfg file? > (I think it is called "include", but I am not sure.) > > . /etc/sysconfig/network-scripts/ifcfg-br0 > > which populates these (and other) variables > > DEVICE=br0 > TYPE=Bridge > ONBOOT=yes > USERCTL=yes > DELAY=0 > NM_CONTROLLED=yes > BOOTPROTO=none > PREFIX=24 > ... > > Many thanks, > -T Hi Todd, FYI, the `.` Bash command is also called `source`, which is easier to search on the Web, and clearer in email: https://ss64.com/bash/source.html The closest equivalent in Raku is: https://docs.raku.org/routine/EVALFILE , which could be used for config data like so: $ cat a.dat $foo = "bar"; $baz = "quxx"; $ perl6 -e 'our ($foo, $baz); EVALFILE "a.dat"; .say for $foo, $baz;' bar quxx , but please do not use it for this purpose. EVALFILE is in all-caps to show that it might be dangerous and not for general use; it is “grep-able evil”, and could eval any valid Raku code, even evil things like `run “rm -rf /“`. IMHO, Bash's `source`-style of loading variables pollutes the main namespace and causes hard-to-debug “action at a distance”. In Raku (or any other dynamic language), the use of some kind of Config module is safer and cleaner: https://modules.raku.org/t/CONFIG https://github.com/raku-community-modules/perl6-Config-JSON https://github.com/Skarsnik/perl6-config-simple https://metacpan.org/pod/Config::Tiny For example: $ cat config.json { "baz": "quxx", "foo": "bar” } $ perl6 -e 'use Config::JSON; my %c; %c{$_} = jconf($_) for ; say %c{$_} for ;' bar quxx $ cat b.dat foo = bar baz = quxx $ perl6 -e 'use Config::Tiny:from; my $conf = Config::Tiny.read("b.dat"); .say for $conf<_>' bar quxx — Hope this helps, Bruce Gray (Util of PerlMonks)
Re: bash "."?
On 2020-05-13 22:27, Bruce Gray wrote: On May 13, 2020, at 9:37 PM, ToddAndMargo via perl6-users wrote: Hi All, Do we have anything like Bash's "." statement where we can read in a bunch of values from a .cfg file? (I think it is called "include", but I am not sure.) . /etc/sysconfig/network-scripts/ifcfg-br0 which populates these (and other) variables DEVICE=br0 TYPE=Bridge ONBOOT=yes USERCTL=yes DELAY=0 NM_CONTROLLED=yes BOOTPROTO=none PREFIX=24 ... Many thanks, -T Hi Todd, FYI, the `.` Bash command is also called `source`, which is easier to search on the Web, and clearer in email: https://ss64.com/bash/source.html The closest equivalent in Raku is: https://docs.raku.org/routine/EVALFILE , which could be used for config data like so: $ cat a.dat $foo = "bar"; $baz = "quxx"; $ perl6 -e 'our ($foo, $baz); EVALFILE "a.dat"; .say for $foo, $baz;' bar quxx , but please do not use it for this purpose. EVALFILE is in all-caps to show that it might be dangerous and not for general use; it is “grep-able evil”, and could eval any valid Raku code, even evil things like `run “rm -rf /“`. IMHO, Bash's `source`-style of loading variables pollutes the main namespace and causes hard-to-debug “action at a distance”. In Raku (or any other dynamic language), the use of some kind of Config module is safer and cleaner: https://modules.raku.org/t/CONFIG https://github.com/raku-community-modules/perl6-Config-JSON https://github.com/Skarsnik/perl6-config-simple https://metacpan.org/pod/Config::Tiny For example: $ cat config.json { "baz": "quxx", "foo": "bar” } $ perl6 -e 'use Config::JSON; my %c; %c{$_} = jconf($_) for ; say %c{$_} for ;' bar quxx $ cat b.dat foo = bar baz = quxx $ perl6 -e 'use Config::Tiny:from; my $conf = Config::Tiny.read("b.dat"); .say for $conf<_>' bar quxx — Hope this helps, Bruce Gray (Util of PerlMonks) Excellent! Thank you!