While there's no howto or open source example I can give, here's a summary of how the pieces fit together.
In the schevogtk2.window.BaseWindow class, there are get_value_handlers and set_field_handlers attributes. They are both lists that contain functions that are called, in the order they appear in the list, to work with widgets that appear for forms that show fields for entities or transactions.
Each get_value_handlers function accepts a widget, then determines if the widget is something it knows how to get a value from.
If it knows how to get the value from it, it will grab the value from the widget and return a structure containing that value and an indicator to not continue.
If it does not know, then the next function will be called.
Each set_field_handlers function accepts a number of arguments, including the database field from which a widget is to be constructed.
If it knows how to construct a widget from the field, it will do so, and return the widget and an indicator to not continue.
If it does not know, then the next function will be called.
For a custom widget, what you'll want to do is define an appropriate get_value_handler and set_field_handler, and then insert those into the beginning of the lists.
I wish I had a more complete example, but SchevoGtk uses this protocol itself for the widgets included out of the box, so you can at least see several implementations of those handler functions.
I hope this helps!
On Thu, Jun 25, 2009 at 06:57, erob
<robillar...@gmail.com> wrote:
On another story, I have a question for Schevo/SchevoGtk2 developers.
I'd like
adding some new widgets in SchevoGtk2. Would you like to explain
briefly how
to add things like radio-buttons, etc ?
--
Matthew R. Scott