Re: General tips about GTK+ programming



Hi Tomaz,
I have to rewrite my game, using some general technique, in other
words I'm a bit tied with this. So, I have to rewrite my code to GTK,
and also I want to learn how to program with it :)
Vlad Volodin

2009/3/3 Tomaz Canabrava <tumaix gmail com>:
from what I'v been into, it's better to write object oriented software
using object oriented programming languages. I know some in this list
dislikes c++ , but it's more sane than use pointers and simulations of
classes.
you will not learn how to program better by converting your gtkmm code
to gtk, your code will be larger and will do the same thing.

On Tue, Mar 3, 2009 at 7:43 AM, Vlad Volodin <vest 84 gmail com> wrote:
Hello, everybody

I'm a new programming in GTK+ (especially under C). Before, I've used
GTKmm with C++ style, and everything was clear till now. I've read
many GTK sources, made by people, and found, that there isn't any
general rule of GUI program creation. Let me explain, what I want.

In GTKmm, I've created a class (Gtk::Window), make public and private
methods, also put there some data, I want to display (that data was
wrapped inside other classes and etc). I didn't use global variables.
If I need to show options dialog window, I've created derived class
(OptionsWindow), and use it, for example in MainWindow class. So, I
think it helps me with navigating inside my sources and make the code
clearer. Main function was too little: i18n, gtkinit, mainwindow
creation, gtkrun.

In GTK world, there are no specific rules, or maybe I didn't find good
one. I saw sources larger than 100-200 kb. They also contains all the
windows, signals, internal data. Some of them has functions like "void
create_gui();", other create main windows as usual "GtkWidget*
create_main_window()".

I've even read some books and tutorials about GTK. And there are also
one file, which creates all, programmer needed. Yes, I saw some
examples named as "Widget Creation". But nobody creates window
widgets. Maybe you know why?

And the last question, for example, I have data, I want to use in GUI.
How should I write or manipulate with it? Should I create it as
structure, derived from GObject? or I have to use global (or static)
objects. and where should I initialize it?

I hope I didn't make you boring. Thank everybody in advance, who will
help me with advices, tips, maybe links and clear sources. I want to
have a general view of GTK programming and rewrite my C++ game made by
GTKmm to GTK, and improve programming skills.

Thank you again
Vlad Volodin
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




--
Um Computador sem Windows à como um Navio sem danÃarinas de Can-Can




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