librelist archives

« back to archive

How to organize gui code

How to organize gui code

From:
Catsquotl
Date:
2011-03-19 @ 12:55
Hi,

Is there a convention on how to organize gui code?
I have a few classes that do some work and one huge Gui class that takes 
care of how flows look and interact.
The gui class i fear is getting more and more cluttered with calling the 
methods from my working classes and then sorting through the return 
values and styling them up to show up in the Gui itself..

I could put some of the gui stuff in the classes themselvesl, but that 
just does not seem right.
Pointers are very much appresiated.

Eelco

Re: [shoes] How to organize gui code

From:
Steve Klabnik
Date:
2011-03-21 @ 13:52
Hey Eelco-

Sorry this took me a few days, my life has been crazy busy lately.

First of all, you might want to check out Hackety Hack. It's the largest
Shoes app that I know of: https://github.com/hacketyhack/hacketyhack

It's not perfect, but basically what it boils down to is this: make liberal
use of modules and 'include.' I'd have a main class that sets up your larger
program structure, and then smaller modules for each part.

I'll give this some more thought, and if your code is open source, I'll take
a look. This is an important issue, though... maybe some "Larger Shoes Apps
Design Patterns" (ha!) are in order...

- Steve

Is there a convention on how to organize gui code?

> I have a few classes that do some work and one huge Gui class that takes
> care of how flows look and interact.
> The gui class i fear is getting more and more cluttered with calling the
> methods from my working classes and then sorting through the return
> values and styling them up to show up in the Gui itself..
>
> I could put some of the gui stuff in the classes themselvesl, but that
> just does not seem right.
> Pointers are very much appresiated.
>
> Eelco
>

Re: [shoes] How to organize gui code

From:
Catsquotl
Date:
2011-03-22 @ 05:54
Hi Steve,

Thanks for your reply.
My first tries for what i am trying to do is here...
https://github.com/Catsquotl/tcm-study

I'll have another look at hackety hack. I have tried it, but it had to 
many errors on windows to work with comfortably.

Any input on my coding and GUI skills are very much appreciated,  I have 
to juggle my time between a full time job, my 6 children and my chinese 
medicine/shiatsu study. So even though i will read all suggestions..It 
may take a while to act upon them or reply here...

Eelco

Op 21-3-2011 14:52, Steve Klabnik schreef:
> Hey Eelco-
>
> Sorry this took me a few days, my life has been crazy busy lately.
>
> First of all, you might want to check out Hackety Hack. It's the 
> largest Shoes app that I know of: 
> https://github.com/hacketyhack/hacketyhack
>
> It's not perfect, but basically what it boils down to is this: make 
> liberal use of modules and 'include.' I'd have a main class that sets 
> up your larger program structure, and then smaller modules for each part.
>
> I'll give this some more thought, and if your code is open source, 
> I'll take a look. This is an important issue, though... maybe some 
> "Larger Shoes Apps Design Patterns" (ha!) are in order...
>
> - Steve
>
> Is there a convention on how to organize gui code?
>
>     I have a few classes that do some work and one huge Gui class that
>     takes
>     care of how flows look and interact.
>     The gui class i fear is getting more and more cluttered with
>     calling the
>     methods from my working classes and then sorting through the return
>     values and styling them up to show up in the Gui itself..
>
>     I could put some of the gui stuff in the classes themselvesl, but that
>     just does not seem right.
>     Pointers are very much appresiated.
>
>     Eelco
>
>

Re: [shoes] How to organize gui code

From:
ashbb
Date:
2011-03-20 @ 03:26
Hi Eelco,

Umm,... difficult question. Sorry, I have no experience to write a big gui
class. xx-P

ashbb