ello :smile:
just wondering if there are any layout type functions im missing for working with gui elements
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
Have you tried vertical-panel% and horizontal-panel% ?
i had not found those yet! thanks :smile:
and a proper newbie thing … (1 2) === [1 2] ??
are square brackets tuples or fixed length lists or something and round brakcets are variable lenth ?
In #lang racket
the default reader handles (), [] and {} in the same way. So it is up to you to use what you like.
There are some conventions though.
Often [] is used around a clauses in an else.
It is also used around let bindings.
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.
This makes it possible to write macros that does different things for (), [] and {}.
So even though the rule in #lang racket
is that they behave the same, you might find some libraries where there are a difference.
ok brill. thanks a ton
one last one …
it seems like when creating UI elements, they have to be give a parent straight away
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
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 ?
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.
Awesome thanks :)
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?
Builtin there is both gui
and framework
.
On the package server there are some more, specialized gui components.
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
things like that maybe
there is a file browser
oh brill, ive missed that one :slightly_smiling_face:
get-file
It’s “hidden” under the header “dialogs”.
ah sorry i ment more like somethign you would find on the RHS of a text editor
Can’t remember seeing a collapsible component (but there might be one)
I think I saw a screenshot of something similar recently - but I am not 100% sure.
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:
alexh has this one: https://docs.racket-lang.org/qresults-list/index.html
(sadly without screenshots)
coolio ill check it out :smile: thanks!
ive been hacking on an idea for the past few nights and so far ive got …
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"))))
ive parked the javascript parsing part for now and going to concentrate on the GUI first
but the idea is to try and make a GUI for editing the test names/descriptions within a project (hopefully evenutally language agnostic)
So that’s what you needed the parser for.
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
pluss figuring out the end of the describe blocks would be difficult with plain ole regex i think
i suppose al alternate approach would be to reduce the whole thing to a language maybe….
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"
then maybe customise a version of drracket and lock it to a single language (or by default at least or something)
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")
@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
(struct describe (description children)
#:constructor-name constructor:describe
#:omit-define-syntaxes)
(define (describe description . children)
(constructor:describe description children))
@deusx9999 has joined the channel