On Friday 06 October 2006 15:53, Richard Hosking wrote:
> Still I always seemed to run into scope problems in getting objects to a
> called widget and back again. Even with global variables/objects (which
> I presume are generally frowned upon)

You don't pass objectes to widgets as a rule.
There is absolutely no need for global variables here either.
If you run into scoping conflicts, you are doing something very wrong.

You set widget state (eg. text_ctrl.Settext("some text")
and you get notified by the messaging system if that state gets changed.

In order to let the messaging system know how to notify you, you register a 
callback function, e.g. OnTextChanged(<pointer to my callback function>)

The validators you mentioned can automatize the setting/getting to and from 
widget state for you

This principle is no different regardless whether you use C++ or Python or 
Ruby, regardles whether it is wxWidgets or QT or whatever event driven user 
interaction framework. All that differs a little bit is syntax and semantics 
how to tell the system what you want

RoR might suit you well because web apps are more linear and less event 
driven, and RoR's schematic model-controller-view paradigm isolates you from 
all this confusing stuff

I strongly suggest to order http://www.elx.com.au/item/0596101325
Less than 150 jargon-less pages that get you going & productive very quick 
without much prior knowledge

Horst
_______________________________________________
Gpcg_talk mailing list
[email protected]
http://ozdocit.org/cgi-bin/mailman/listinfo/gpcg_talk

Reply via email to