I already asked this hidden in a another thread, but got no answer:
(how) is it possible to add a new "Widget Type" to Lazarus using a Lazarus packet ?
Thanks,
-Michael

Mailing lists / lazarus / 2010-03
6 messages · 3 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
I already asked this hidden in a another thread, but got no answer:
(how) is it possible to add a new "Widget Type" to Lazarus using a Lazarus packet ?
Thanks,
-Michael
This is not possible at the moment.
Best regards,
Paul Ishenin.
Paul Ishenin wroteThis is not possible at the moment.
That is really bad news :(.
How to proceed ?
I think a package can add a directory with files.
I do know that I can add a "New->xyzApplication" Project Type by doing a Package.
I suppose this Project Type can define compiler options.
Maybe I can set the compiler options in a way that the new Application uses the directory created by the package for the used "hidden" Widget type ?
In the end I would be happy if the new Widget Type could be included in the distribution standard and that the appropriate parts of the source code (i.e. the event queue implementation) could be modified in a way that it can be used by both the new and the standard widget set.
What do you think ?
-Michael
This is not possible at the moment. Paul Ishenin.
In fact I found that it's very easy to create and debug your own Widget Type. You just create a unit called "interface" and add it to the project.
I suppose adding the directory to the path would suffice. (So, using a Lazarus Package, the "application generator" defined by same can be configured to offer an Application Type using a new Widget Type, even if same can't be selected in the "Project Options" yet.)
Doing this, I succeeded in enhancing the "NoGUI" Widget Type to be slightly less dummy than it was. Now I can create a (simple !!! but working) normal (GTK2) Application and afterwards set the Widget Type to NoGUI in the "Project Options" (or add the new units (including "Interface") to the Project (or Path) ), and I can compile and run the project without changing the source code.
(The original NoGUI Widget Type allowed to compile the project but when running it, it crashed within "Application.CreateForm, as the TForm this Widget Type creates, does not get a handle.)
Of course the new Widget type does nothing useful yet, other than create an invisible dummy form, but in "Application.CreateForm", it calls the form's "OnCreate" and "OnActivate" events before it stops in "Application.Run".
What I did, is just define the Classes TNOGUIWSCustomForm, TNoGUIPrivateScrollingWinControl, and TNoGUIWSScrollingWinControl and have them registered when the Widget Type is registered with the application. (The current NoGUI application was a nice template for that, enhancements made according to the GTK2 Widget Type code.) The only code that is performed in the new classes is create a handle 0 so that the "Forms" unit thinks the Widget for the appropriate TForm decedent is successfully created.
-Michael.
P.S.: What is the current version of the NoGUI Widget Type actually used for ? I supposed it can be used together with FPGUI, but this in fact is another predefined Widget Type.... ?
Thanks, -Michael
Michael Schnell wroteP.S.: What is the current version of the NoGUI Widget Type actually used for ? I supposed it can be used together with FPGUI, but this in fact is another predefined Widget Type.... ?
It is for non gui applications like lazbuild or web applications, that like againts the LCL, but don't use its gui classes, like TApplication, TControl and TForm.
Vincent
That should read: "... that link against the LCL ..."
Or as Mattias said, answering another post from you:
The nogui widgetset is for applications, that uses the LCL, but doesn't use the widgetset functions. The nogui widgetset simply makes the compiler happy.
http://lists.lazarus.freepascal.org/pipermail/lazarus/2010-March/050270.html
Vincent