[Glade-users] Separation between GUI and main



Il 20/01/2012 17.27, Tristan Van Berkom ha scritto:

If you need to control the state of a widget in the interface, you need
a pointer to that widget.

If you add a widget to your interface, say a button that causes a new
action you need to handle, then you don't need a pointer to that button.

Eureka!
See, this could be enough for today: the key is "I don't need an handler 
for everything, I can just use the callback".



A common practice is to use the last argument of 
gtk_builder_connect_signals(),
you can create a data structure which contains the needed pointers 
for your
whole module, i.e.
[SNIKT]
This is common practice but still old-fashioned if you ask me.

I read about it, I'm still trying to understand it, though...
I think I have to compile and run some real examples to actually see the 
problem and then try to learn the solution.



Better practice still, is to derive a GtkContainer for every modular
GUI object which can be used and reused throughout your GUI.

This is way beyond my actual level of game, but thanks, I'll flag this 
mail for future reference when my skills will allow me to understand...

Really appreciate.
-- 
Regards,
Manuel Ferrero
R&D department

Reer SpA        
Tel.  +39 011 2482215
Fax. +39 011 859867

L'utilizzo non autorizzato del presente messaggio e' vietato e potrebbe costituire reato.
Se il presente messaggio non e' a Lei indirizzato, il suo contenuto non deve essere considerato
come trasmesso o autorizzato dalla Reer SpA; in tale caso Le saremmo grati se, via e-mail,
ce ne comunicasse l'errata ricezione.

The unauthorized use of this e-mail is prohibited and could constitute an offence.
If you are not the intended recipient of this message its contents shall be understood as neither
given nor endorsed by Reer SpA. Please notify Reer SpA by e-mail immediately in that case.





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