without using css (if it’s possible to use pseudoc...
# tornadofx
h
without using css (if it’s possible to use pseudoclasses with tfx), are there specific functions for pseudo classses? Like on hover, for tfx?
r
I'm not sure I understand your question, but I can't think of any reason to use them outside CSS, as they are really just glorified booleans for interactive styling.
h
well i was making a seating application, and i wanted to add interactivity to the seat that was hovered. to do that, i had to create two methods for each seat; mouse enter & exit, and then i had to make extra values for getting the fill before the seat was hovered, so i could set it to that again after they stop hovering over it
r
Why not just use CSS for that?
h
is there a way to define pseudo classes using tornadofx css?
without using a stylehseet
r
I'm not sure what you're asking. CSS is a stylesheet. That's what the SS part stands for.
h
i meant without using a .css file, using the statically typed css that comes with tornadofx
r
That makes more sense. So my next question is, what do you mean by define? You can use the
csspseudoclass
delegate just like you use the
cssclass
delegate. For example:
Copy code
// equivalent to '.fred'
val fred by cssclass()
// equivalent to ':fred'
val fred by csspseudoclass()
h
i was asking, how can i use that typed css to define pseudo classes
r
Did my example not answer your question?
h
it indeed did. thank you
r
Alright, good. I still wasn't sure we were quite on the same page 🙂
h
ah, my bad.
r
Not really. I have a propensity for misunderstanding people.
h
well ¯\_(ツ)_/¯
have a nice day!! 🙂
r
You too 🙂