FLTK logo

Re: [fltk.general] Re: Radio buttons in menus

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Re: Radio buttons in menus "'Matthias Melcher' via fltk.general" 09:13 Apr 16  
 
er...@seriss.com schrieb am Dienstag, 16. April 2024 um 17:05:31 UTC+2:

On 4/15/24 12:38, 'Matthias Melcher' via fltk.general wrote:

I like to use a trick to avoid re-allocating menu item arrays:

    Huh, I never worried about re-allocating menu item arrays..
    do you avoid it because it's slow, or is the idea to allow pointers to not change?

Reallocating unnecessarily fragments memory. find_item() walks the menu array every time. It's all absolutely irrelevant on a modern PC. I like that menus are not reallocated and my pointers stay valid. Especially under FLUID, which calculates widget addresses during initialization, this would be a concern. It does not really matter.

So, yes,  find_item() every time is just as fine.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/5f2eef19-e624-4da8-a14b-61222d153532n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.