Ryan Fleury Profile picture
May 9 5 tweets 3 min read
@Skytrias [1/n] I haven't covered that yet (I will probably do it in the next part), but I control properties like size, colors, fonts, and some other things with stacks. So, for example, you might push a default size for each axis on the stack (as well as a default font, etc.), then...
@Skytrias [2/n] ...if you want to deviate a size, color, font, etc. for a button, you would just push a new value onto the associated stack before the button call, and then pop afterwards.
@Skytrias [3/n] I am really not that big of a "go nuts with C macros" guy, but there's one exception, and that's these widget property stacks. It all comes down to this:

#define DeferLoop(start, end) for(int _i_ = ((start), 0); _i_ == 0; _i_ += 1, (end))
@Skytrias [4/n] This is a utility that can "tag" a scope with an arbitrary `begin` and `end` expression. That's very useful for these scopes:

#define UI_PrefWidth(v) DeferLoop(UI_PushPrefWidth(v), UI_PopPrefWidth())
@Skytrias [5/5] This can then be used like so:

UI_PrefWidth(UI_Pixels(100, 1.0f)) UI_Button(...);

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Ryan Fleury

Ryan Fleury Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @ryanjfleury

Aug 18, 2020
@AbnerCoimbre @notnullnotvoid @handmade_net I will provide my personal thoughts about Handmade, and maybe we can work towards an understanding of the manifesto, if/how it should be revised, etc. (1/7)
@AbnerCoimbre @notnullnotvoid @handmade_net My experiences with @handmade_net have provided a lot of insight here, namely in that Handmade *isn't* just about making things fast, it's about knowing when to allow things to be slow, and reasoning about reality. I like @AbnerCoimbre's "computer literacy" idea here. (2/7)
@AbnerCoimbre @notnullnotvoid @handmade_net "Handmade" isn't exactly rigorously defined, though I think it's more important that we gather as a community, dedicate ourselves to making better software, caring about the end user, and wanting to understand the reality of our problems. (3/7)
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(