[Iup-users] Tiny, tiny bugs

Geoff Leyland geoff_leyland at fastmail.fm
Tue Mar 4 19:31:04 GMT+2 2008


Thanks Antonio, what an amazing turnaround!

>> CD Docs: Coordinate systems: cdCanvasGetSize: the lua version
>> should be canvas:GetSize
>
>   Fixed. BTW, the implementation is correct.

Yep, I'm using it :)

>> I have a CD canvas inside an IUP canvas which is inside an
>> hbox, which is in turn inside a dialog.  I don't get any
>> resize events for the IUP canvas when it is smaller than its
>> original size.  When I remove the hbox, the resize events
>> work as expected.  Anything I might be missing?  Any hints on
>> where I should look in the IUP code?
>
>   If you set the SIZE or RASTERSIZE attributes they will be used as  
> minimum
> sizes. After IupShow or IupMap, set to NULL. Then you will be able  
> to freely
> resize the canvas.

Thanks.  I set rastersize to nil in the canvas's map_cb and it worked  
a charm.

>> When I put scrollbars on the same IUP canvas, changing dx and
>> dy don't seem to change the size of the scroll bar thumb.
>
>   This is a flaw in IUP 2. You must set POSX and POSY for the  
> scroolbar to
> be updated:
>
>     IupStoreAttribute(ih, "POSX", IupGetAttribute(ih, "POSX"));
>     IupStoreAttribute(ih, "POSY", IupGetAttribute(ih, "POSY"));
>
>   I fixed this in IUP 3. So it will be enough to set DX or DY to  
> update the
> thumb.


I added a self.posx = self.posx, but it didn't help.  However, it was  
enough to find setposx in winset.c (and see there's no setdx there)  
and find out what it was doing.

Turns out that I was initializing the canvas with scrollbar="yes",  
having thought I had read somewhere that from Lua capitals didn't  
matter.  The lower-case "yes" was enough to get the scrollbar  
showing, but not enough for the

(IupGetAttribute(n,IUP_SCROLLBAR) && iupStrEqual(IupGetAttribute 
(n,IUP_SCROLLBAR),IUP_YES))

in setposx.  Easily fixed by changing the canvas initializer to  
scrollbar="YES".


Cheers,
Geoff



More information about the iup-users mailing list