Bug? Fonts and AddGadgetItem

Just starting out? Need help? Post your questions and find answers here.
mark5009
User
User
Posts: 22
Joined: Sun Oct 19, 2014 10:47 pm

Bug? Fonts and AddGadgetItem

Post 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.
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Bug? Fonts and AddGadgetItem

Post 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
PureLust
Enthusiast
Enthusiast
Posts: 486
Joined: Mon Apr 16, 2007 3:57 am
Location: Germany, NRW

Re: Bug? Fonts and AddGadgetItem

Post 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
[Dynamic-Dialogs] - create complex GUIs the easy way
[DeFlicker] - easily deflicker your resizeable Windows
[WinFX] - Window Effects (incl. 'click-through' Window)
User avatar
deeproot
Enthusiast
Enthusiast
Posts: 289
Joined: Thu Dec 17, 2009 12:00 pm
Location: Llangadog, Wales, UK
Contact:

Re: Bug? Fonts and AddGadgetItem

Post 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.
Post Reply