Page 1 of 1

OpenWindow()

Posted: Tue Apr 11, 2006 7:17 pm
by MVXA
Hi
I think, this is now a bug and not my fault <_<...

Code: Select all

;
;   Avatar Maker
;

Global lAvatarImg.l

lAvatarImg = CatchImage(#PB_Any, ?resAvatar_Start)
If lAvatarImg
    If OpenWindow(1, 1, 1, ImageWidth(lAvatarImg), ImageHeight(lAvatarImg), "Avatar")
        Debug ImageWidth(lAvatarImg) ; is 100
        Debug WindowWidth(1) ; But this is 106 o_O
    
        CreateGadgetList(WindowID(1))
            ImageGadget(2, 0, 0, ImageWidth(lAvatarImg), ImageHeight(lAvatarImg), ImageID(lAvatarImg))
            
        Repeat
            Select WindowEvent()
                Case #PB_Event_CloseWindow
                    Break
            EndSelect
        ForEver
    EndIf
EndIf


DataSection
    resAvatar_Start:
        IncludeBinary "C:\Avatar.bmp"
    resAvatar_Stopp:
EndDataSection

Posted: Tue Apr 11, 2006 7:24 pm
by netmaestro
There is a minimum window width for a bordered window, its more than 100. It's a windows limitation, not your fault or that of PureBasic. You have to make it borderless if you want something smaller. Try your test with #PB_Window_Borderless. (you'll have to close it with alt-F4)

Posted: Tue Apr 11, 2006 7:32 pm
by MVXA
is there a way to find out the border size?

Posted: Tue Apr 11, 2006 7:34 pm
by Fred
We added a note to the doc to tell this 'feature'.