chris613
2019-9-21 09:36:50

ello :smile:


chris613
2019-9-21 09:37:16

just wondering if there are any layout type functions im missing for working with gui elements


chris613
2019-9-21 09:37:59

just now, when i create text fields etc and give them a parent object, they all end up ontop of peach other within the panel


soegaard2
2019-9-21 09:40:55

Have you tried vertical-panel% and horizontal-panel% ?


chris613
2019-9-21 09:42:26

i had not found those yet! thanks :smile:


chris613
2019-9-21 09:44:37

and a proper newbie thing … (1 2) === [1 2] ??


chris613
2019-9-21 09:45:09

are square brackets tuples or fixed length lists or something and round brakcets are variable lenth ?


soegaard2
2019-9-21 09:46:27

In #lang racket the default reader handles (), [] and {} in the same way. So it is up to you to use what you like.


soegaard2
2019-9-21 09:46:34

There are some conventions though.


soegaard2
2019-9-21 09:46:56

Often [] is used around a clauses in an else.


soegaard2
2019-9-21 09:47:13

It is also used around let bindings.


soegaard2
2019-9-21 09:48:25

When the reader has a read a form written using [] or {} it marks the resulting syntax object with a property, so a macro can check whether [] and {} has been used.


soegaard2
2019-9-21 09:48:51

This makes it possible to write macros that does different things for (), [] and {}.


soegaard2
2019-9-21 09:49:34

So even though the rule in #lang racket is that they behave the same, you might find some libraries where there are a difference.


chris613
2019-9-21 09:49:48

ok brill. thanks a ton


chris613
2019-9-21 09:51:56

one last one …


chris613
2019-9-21 09:52:28

it seems like when creating UI elements, they have to be give a parent straight away


chris613
2019-9-21 09:53:23

i kinda want to map over my list of data and set of ui elements and then have a seperate function add those to the UI in whichever way


chris613
2019-9-21 09:54:38

is there a way to initalize those objects without passing in the parent param? or will i have to return some sort of factory function during my map process and call them later with a parent ?


soegaard2
2019-9-21 09:56:18

There is a method reparent. So you could make a “root parent” and use that to initialize the elements, then later use reparent to install the real parent.


chris613
2019-9-21 09:57:46

Awesome thanks :)


chris613
2019-9-21 21:23:45

been looking on the racket package manager and i cant see any sort of high level GUI component libraries. am i missing something or is it not really a thing in this eco system? thinking something equivilent to bootstrap or martial UI in the web world with some “sensible defaults”/ an implimentation of a design system, maybe theming ability?


soegaard2
2019-9-21 21:24:34

Builtin there is both gui and framework.


soegaard2
2019-9-21 21:26:23

On the package server there are some more, specialized gui components.


chris613
2019-9-21 21:26:24

yeah, im using gui just now, and my skimming of framework is that it adds a lot of stuff ill probably need in the future, but not really any more “components”? i.e. directory file browser, maybe breadcrumb navigation component, or collapsible component


chris613
2019-9-21 21:26:30

things like that maybe


soegaard2
2019-9-21 21:26:58

there is a file browser


chris613
2019-9-21 21:27:07

oh brill, ive missed that one :slightly_smiling_face:


soegaard2
2019-9-21 21:27:27

get-file


soegaard2
2019-9-21 21:28:01

It’s “hidden” under the header “dialogs”.


chris613
2019-9-21 21:28:25

ah sorry i ment more like somethign you would find on the RHS of a text editor


soegaard2
2019-9-21 21:28:28

Can’t remember seeing a collapsible component (but there might be one)


soegaard2
2019-9-21 21:29:05

I think I saw a screenshot of something similar recently - but I am not 100% sure.


chris613
2019-9-21 21:30:17

i suppose the other main benifit of something like bootstrap / material UI is its not a bad starter pack for someone like me whos no good at design :wink:


soegaard2
2019-9-21 21:31:00

soegaard2
2019-9-21 21:31:06

(sadly without screenshots)


chris613
2019-9-21 21:31:23

coolio ill check it out :smile: thanks!


chris613
2019-9-21 21:34:02

ive been hacking on an idea for the past few nights and so far ive got …


chris613
2019-9-21 21:34:16

which comes from the data struct (define file1 (describe "when doing a thing" (list (it "should do first thing") (it "should do second thing") (describe "a sub-section" (list (it "sub task 1") (it "sub task 2"))) (it "should do third thing") (it "should do forth thing"))))


chris613
2019-9-21 21:34:47

ive parked the javascript parsing part for now and going to concentrate on the GUI first


chris613
2019-9-21 21:35:27

but the idea is to try and make a GUI for editing the test names/descriptions within a project (hopefully evenutally language agnostic)


soegaard2
2019-9-21 21:37:12

So that’s what you needed the parser for.


chris613
2019-9-21 21:38:13

yeah, the parser would generate the tree of test descriptions. i got the regex stuff wokring well, but then realised im goign to need to pull out start & end positions of the decriptions to push modifications back into the original file


chris613
2019-9-21 21:38:53

pluss figuring out the end of the describe blocks would be difficult with plain ole regex i think


chris613
2019-9-21 21:42:27

i suppose al alternate approach would be to reduce the whole thing to a language maybe….


chris613
2019-9-21 21:42:29

describe "when doing a thing" it "should do first thing" it "should do second thing" describe "a sub-section" it "sub task 1" it "sub task 2" it "should do third thing" it "should do forth thing"


chris613
2019-9-21 21:43:22

then maybe customise a version of drracket and lock it to a single language (or by default at least or something)


chris613
2019-9-21 21:51:55

sorry to bug again, but is there a way of defining a struct with the last param as a rest args ? something like (struct describe (description …children)) so that (describe-children (describe2 "hello" 1 2 3 "hi")) ==> '(1 2 3 "hi")


notjack
2019-9-22 00:17:53

@chris613 Sort of. You can define your own constructor, but if you want it to have the same name as the regular constructor would you need to use #:constructor-name and #:omit-define-syntaxes


notjack
2019-9-22 00:20:29
(struct describe (description children)
  #:constructor-name constructor:describe
  #:omit-define-syntaxes)

(define (describe description . children)
  (constructor:describe description children))

deusx9999
2019-9-22 03:52:26

@deusx9999 has joined the channel