[Gambas-user] Sample component with a form

Tobias Boege taboege at ...626...
Thu Mar 26 23:15:04 CET 2015


On Thu, 26 Mar 2015, Roel Touwen wrote:
> Hi everyone,
> 
> Has anybody a sample source of a component which holds a form? I'm 
> trying for two weeks now and I simply don't succeed.
> 
> What I want to do is have form that I can embed in another form (within 
> a tab). I could use a workspace but people can delete the tab then.
> 

It's not clear to me what you want to do. You must know that the term
"component" around Gambas usually means a shared library which adds
functionality to the interpreter. gb.qt4, for example, is the QT4
component.

I'll assume that you want to create just a "widget" class which is usually
called a "control", instead of component. [ A component is a whole
collection of classes, and sometimes also controls, for a specific task. ]

But you don't need to create a new control class either. Embedding forms
is super easy. Again, assuming that I understood you, I attach a project
which shows how to embed some instance of a Form class into a TabPanel
where you can control, contrary to Workspace, if the user is able to close
a tab.

Note: On my system, the first form which is embedded into a tab of the
TabPanel is not resized, while all subsequent forms are expanded to fill
their tab. I don't know why...

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tabpanel-embed-form-0.0.1.tar.gz
Type: application/octet-stream
Size: 4502 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20150326/de3122fa/attachment.obj>


More information about the User mailing list