I think being able to use controls from userlibs like any other gadget would be very useful. But instead of, for example, putting UseCalendarGadget() at the beginning of the code, the third party gadget would register itself when called, let's say:
Code: Select all
CalendarGadget(0, xPos, yPos, #Current_Month)
This CalendarGadget registers itself, and gives the GadgetPlugin lib the address for the common gadget functions, or 0 for the ones it doesn't support:
FreeGadget
GadgetHeight
GadgetID
GadgetItemID
GadgetToolTip
GadgetWidth
GadgetX
GadgetY
etc...
So the third party gadget can be programmed in PureBasic like any other gadget, with its index number, no matter if it's a COM control or whatever. Of course, third party gadgets shouldn't use the Gadget library. I think this could be very useful. If I haven't explained myself, please, tell me.
Note: I don't have any intention of coding a CalendarGadget, it's just an example (but I have others in mind).