2019r2 Bevel Button Menu

How are you supposed to clear a bevel button menu in 2019r2 - DeleteAllRows is deprecated and there’s no mention of an alternative?
The documentation shows you how to create a menu, but not how to rebuild an existing one.

As an aside, can anyone explain why they removed the current event highlighting from the navigation pane of the iDE, that was genuinely useful.

Any pointers on the bevel button issue would be appreciated.

Jack

Does a RemoveAllRows work?

BTW: BevelButton Methods are missing in the LR. Can you please create a FR?

http://documentation.xojo.com/api/deprecated/bevelbutton.html

No … the Analyzer says “DeleteAllRows is deprecated. You should use Use Menu property instead.”
The documentation says nothing about rebuilding the menu and losing the current contents.

deprecated ? removed
you can just keep using those methods as they still exist and just ignore the deprecation warning

be aware that bevel buttons on macOS are not dark mode savvy

Yes … I get that. I am making major changes to an existing program and thought I may as well bring the application up to date at the same time and resolve the deprecated items. The documentation on this is deplorable. I’ve now figured out how to clear the existing menu, took me most of the morning, I’m now trying to figure out how use it. MenuValue seems to have gone as well.

grab my replacement for bevelbutton and be off to the races :stuck_out_tongue:
https://github.com/npalardy/BevelButtonReplacement
get dark mode support and dont change any of your code either :slight_smile:

I’ll have a go … thanks for that.

In case of trouble, the Menu is just an Array and you could do something like:

[code]Var i As Integer
i = Me.Menu.Count-1

If i > 0 Then

For X As Integer = i DownTo 0

Me.Menu.RemoveMenuAt(X)

Next

End If[/code]

Oh! For those who want to do their own tests, add a Me.Menu = New MenuItem before adding new Elements to a BevelButton Menu. This is missing in the LR.

[quote=457331:@Norman Palardy]grab my replacement for bevelbutton and be off to the races :stuck_out_tongue:
https://github.com/npalardy/BevelButtonReplacement
get dark mode support and dont change any of your code either :)[/quote]

Thanks for the link it looks really good.

For a second I was frightened from the MBS related code but then I noticed that everything works without it using declares, too.

This is calling for a Push Request! :wink:

you flip one boolean in the source :slight_smile:

Ha! Smart! Thank you @Norman :slight_smile: