[lazarus] Tree within library

SteveG steveg at nevets.com.au
Wed Apr 30 11:27:31 EDT 2003


Mattias
Your example does works ok, so I have imported your code into a small 
project to demonstrate my problem. (attached)
when running, you 'should' see that the 
speedbuttons/statictext/image/tree all disappear/corrupt when a window 
is moved over the top of them. Also notice that the tree items can not 
be selected once the library has opened, but the edit field works ok.

In this example, it seems the library form is fine, but the main app 
form shows the problem - probably solve one, solve all.

Thanks


Mattias Gaertner wrote:
> On Tue, 29 Apr 2003 10:43:44 +1000
> SteveG <steveg at nevets.com.au> wrote:
> 
> 
>>Mattias Gaertner wrote:
>>
>>>On Mon, 28 Apr 2003 00:12:24 +1000
>>>SteveG <steveg at nevets.com.au> wrote:
>>>
>>>
>>>
>>>>a few questions this time:
>>>>
>>>>First, problems using Forms in a library (.so)
>>>>1. If using a TTreeView I get an error msg - ERROR: 
>>>>[TgtkObject.CreateBitmap] Illegal depth 0,
>>>>as the library initializes, and am unable to focus on any items.
>>>>Works ok on a standard test program -
>>>
>>>
>>>I tried dynamic libs under fpc a few months ago and ran into several
>>>problems. How do you create the libs?
>>>
>>
>>I load / unload my libraries with the following code (sample library as 
>>attachment)
>>  pStr1:=StrAlloc( 255 ); 
>>
>>  StrPCopy( pStr1, npFindFile('libLxSystem.so', npAppPath(), 0) ); 
>>
>>  LxSystem_LibAddr := dlopen( pStr1, 1 ); 
>>                                                        StrDispose( 
>>pStr1 ); 
>>
>>  pointer( LxSystem_LxCmdIn_1 ) := dlsym( LxSystem_LibAddr, 'LxCmdIn_1' );
>>
>>
>>if LxSystem_LibAddr <> Nil then dlclose( LxSystem_LibAddr ); 
> 
> 
> I only got access violations.
> 
> Use cmem as heapmanager. Add it as first unit in the library.
> Then a treeview seems to work.
> See attachment.
> 
> 
> 
>>>>2. If the form is sent behind another, then brought back to the front, 
>>>>all TStaticTest objects and TSpeedbuttons have disappeared and the 
>>>>screen needs to be re-drawn in code to refresh
>>>
>>>
>>>Normally the gtk sends an expose event in such cases, which results in a
>>>LM_PAINT message. Can you send me an example?
>>>
>>
>>The sample library I have attached will cause the above problem - would 
>>you prefer me to supply a working exe/lib example ?
> 
> 
> There are also 3 TSpeedButtons in the attached example, which don't have the
> problem you described. Maybe it's an windowmanager issue.
> 
> 
> Mattias



-------------- next part --------------
A non-text attachment was scrubbed...
Name: gz00022.gz
Type: application/octet-stream
Size: 13591 bytes
Desc: "prg2.tgz"
Url : http://localhost/pipermail/lazarus/attachments/20030430/9a4f866f/gz00022.obj


More information about the Lazarus mailing list