Re: basic libglademm and design questions



> > 1. the examples always name the variables for GUI elements pButton or m_pButton. Why does they use the "p"? What does it stands for?
> 

Rather than creating an actual Gtk::Button element you create a pointer
to a button, therefore the p.

If you had an actual object you would access its elements with a ".",
but since it is a pointer you need to access them with "->" to
dereference. I guess people like putting the p in order to remind them
of that, especially if you separate declaration and implementation in
two or multiple files.

The m_ stands for "my" or something like that and is usually prefixed if
you have created some class and can't think of a better name for its
instance.. you just call it m_ClassName :)

Can't answer the other questions because I handcode my UI. I'm sure
glade has some auto code constructors for providing signal handlers and
connecting them for you, thereby producing skeleton code. Ah yes indeed
it does. If you click on the "Signals" tab in the interface designer for
a certain object you will see that you can name the handler and even
handled objects directly there.

-Bartek




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