DC (I do not know if he wants his name being published), implemented a mechanism that allows to assamble the widgets of a generic WT application with help of an XML file. I was thinking to do something similar, I even made reference to it on my earlier post on the mailing list. I was not sure that xml was the best choice. My idea was to create a “wrapper html” file, the stuff that web designers love, and position inside this html file the different controls. This html file would have been the root control, and the application would have assembled the widgets based on the information contained inside the html file. So again this html file would have been the design html for web designer and also the “imput file” for the programmer. Anyway the implementation that DC started is fine, as from the “layout” html file I was mentioning above one could generate the xml configuration file.
After DC published his work on the mailing list I made some comments about some details nice to have.
- a mechanism to connect signals with slots
- a mechanism to specify data sources for the widgets
I am afraid that I was not understood regarding the data source. I was writing earlier on the mailing list also about database connectivity, and libraries that would allow such connectivity (I called it data source). Choosing a good database connectivity engine (library), and linking against our generic program, it would be interesting to configure in the same XML file the database and table name (and eventually sql statement) that would feed a certain widget. Exactly as our funny friends Visual Basic or Delphi did. Example, you add to your XML file a new combobox with some country names. You do not want to add code that would only feed the control, recompile, etc., but you would rather specify it in the xml file for that widget something like as “<datasource database=”blahblah” table=”countries” row=”name”/>. When building the widget if such datasources are specified, with some simple and generic mechanism the widget would be loaded with the “name” column from the countries table.
Or something similar, once the combobox with countries loaded, you add a text view control, and link the <selection changed> signal of the combobox with some slot in the text view control. The view control would have sthg. like <datasource database=”blahblah” view=”select description from countries where name=***selected country***>.
Unfortunatelly I do not have time to go deeper into details, I would love to do so, I would love to find myself the solution, but I believe this would make wt much more fun to use… even for beginners.
I think it would be also a nice marketing stuff for WT. Create wt application in 3 steps. The user would have to download the “generic executable” (that is what windows kidZZ love
). Run the executable, it would open port XXX. Then go with browser, http://localhost:XXX/admin. The admin page will show you a simple start control, and some mechanism to add/remove controls, specify signal slot connections, etc. What would be the next step… add some simple python/ruby code to add more functionality ?
Hm… I do not think this is a dream… Isn,t it? 