Page 1 of 1

Bug? Fonts and AddGadgetItem

Posted: Mon Feb 15, 2016 6:44 am
by mark5009
Hi.

I have something that is not obvious and feels wrong. It might be me.

Code: Select all

If OpenWindow(0, 0, 0, 322, 150, "EditorGadget", 
              #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
   EditorGadget(0, 8, 8, 306, 133)
   LoadFont(1, "Menlo", 13, #PB_Font_Bold)  ;; load the font
   SetGadgetFont(0, FontID(1))  ;; set the gadget font

   For a = 0 To 5
      AddGadgetItem(0, a, "Line "+Str(a))  ;; all good, uses loaded font
   Next

   For a = 0 To 5
      AddGadgetItem(0, -1, "Line "+Str(a))  ;; no font bolding, no font change
   Next
   Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Seems like when I add lines at the end (using -1 to AddGadgetItem()), it ignores the font.

This is PureBasic 5.42 Beta 1 LTS (MacOS X - x64) under OSX 10.9.5

Any thoughts?

Thanks .. mark.

Re: Bug? Fonts and AddGadgetItem

Posted: Mon Feb 15, 2016 1:38 pm
by Dude
Does it work if you remove this line? So that only the "-1" parameter is used?

Code: Select all

AddGadgetItem(0, a, "Line "+Str(a))  ;; all good, uses loaded font

Re: Bug? Fonts and AddGadgetItem

Posted: Mon Feb 15, 2016 2:20 pm
by PureLust
mark5009 wrote:This is PureBasic 5.42 Beta 1 LTS (MacOS X - x64) under OSX 10.9.5
Seems to work fine with PB 5.41 LTS on Win-x86

Re: Bug? Fonts and AddGadgetItem

Posted: Mon Feb 15, 2016 2:30 pm
by deeproot
Appears to work correctly on Windows 7 x64, PureBasic 5.42 Beta 2 - all lines in bold font.

But on my iMac behaviour is as described by mark5009 - lines added with -1 ignore the font. This remains true if the first AddGadgetItem loop is removed. Tested on Mac OS 10.6.8 x86, PB 5.42 Beta 2 LTS

Looks like a bug to me.