Re: code organization style



I'm currently exploring a "Good Way" :-p and plan to release a tutorial
after my exploration. But you would have to wait a couple of weeks,
maybe a month since english is not my mother langage (-actually my
mother can't speak english at all-) .

Everything has begun here on this mailing list about a "GladeXML doc patch"
http://mail.gnome.org/archives/gtk-perl-list/2005-April/msg00097.html

Thanks to this mail, I discovered that you can use object to connect
signal from a GladeXML file.
I'm not a Object Purist, but since Gtk is object oriented (like almost
every graphical toolkit) it make sense to use object to design your GUI
behaviour.

basicaly, the idea is this one : for each window (or form) you got one
perl object, with his own Glade xml file or buffer. so you just have to
instanciate an object to create a window. and callbacks are object's
methods. Then you can even forget how it works !

You can even use object style at (custom) widget level, if some widget
should have typical behaviour everywhere in your program, just subclass
it, and create default answer (functions) to some common callbacks. You
can use this kind of widget in Glade-2 through "Custom Widget".

to Muppet : one answer for deployement in some case can be to use the
PAR module (see CPAN for it) especially on some exotic OS like
Microsoft's Windows.


I hope it can help, If I'm not clear (actually I don't think I am) you
can find me on the IRC channel gtk-perl. (where I am known as Pik).

Pierre




Gabor Szabo wrote:

As I have just started to learn Gtk and never wrote anything more than one
simple window in Tk either I would like to get your opinion on how to
organize code ?

So far I have an application with several windows all in one file of
over 1000 rows.
It is getting too big for one file so I am think of splitting it up
and puting each
popup window in a separate class.

Also the main window has two panes, both of the are TreeViews and are getting
complex so I think I should put each one of the in a separate class.

How do you people do it ?
Where can I see examples ?

Gabor
_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]