egality has quit [Remote host closed the connection]
dviola has quit [Remote host closed the connection]
dviola has joined #ruby
otisolsen70 has joined #ruby
shokohsc5103 has joined #ruby
shokohsc510 has quit [Ping timeout: 246 seconds]
shokohsc5103 is now known as shokohsc510
infinityfye has quit [Quit: Leaving]
otisolsen70 has quit [Quit: Leaving]
willfish has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
seydar has joined #ruby
seydar has left #ruby [#ruby]
seydar has joined #ruby
<seydar>
i'm writing my first GUI app (using glimmer-dsl-libui), but i'm struggling to imagine how i should be organizing my code for it. anyone have any advice or good examples?
___nick___ has quit [Ping timeout: 246 seconds]
_ht has quit [Quit: _ht]
<weaksauc_>
seydar what are you making?
<seydar>
weaksauc_: a simulator for an electric grid/network analysis: https://ibb.co/fkhwk8Y
<seydar>
it's pretty useless but it's been a lot of fun to write. i have the CLI and am now trying to make a GUI for it
<seydar>
i'm struggling to imagine how to translate MVC to a GUI, and figured someone here might have some wisdom or insight
<weaksauc_>
well you could take cues from mac or windows programming
<weaksauc_>
have a window controller that delegates certain actions to certain elements
<weaksauc_>
wires up the tableview to a tableviewcontroller
<weaksauc_>
etc
<weaksauc_>
the models do the work of massaging the data into things that you can use on the frontend
<weaksauc_>
how is the CLI partitioned seydar
<seydar>
how should i manage global state?
<johnjaye>
there's probably textbooks on this kind of thing
<johnjaye>
maybe the lack of such is why cs is not real engineering
<seydar>
if all of the aspects of the GUI are going to deal with a `@grid` variable, i'm not sure how to have that accessible in a sane way
<weaksauc_>
you can pass it in as an initializer
<johnjaye>
seydar: what would be the ruby way to only let certain files use a class? require statement?
<seydar>
meh you can't really restrict it like that
<seydar>
and the initializer is prolly what i'm going to do, but i'm leaning towards having a global state hash that is always accessible
<seydar>
certainly makes saving state easier, since i just have to save that one variable
<weaksauc_>
it's almost never a good idea to have global state but you can try it
<seydar>
my other option is to create this global state hash and then initializing every controller with that
<seydar>
the benefit of having the controllers vs creating and including files with the appropriate logic is that i don't risk namespace collision, which is good
<weaksauc_>
seems like they want you to do it their way