Any GraffitiToolbar and GraffitiMenu Working Examples?

Anybody have an example of a GraffitiMenu attached to a GraffitiToolbar that is working? Not much for example programming to go off of and I’m pulling my hair out trying to figure it out based on GraffitiSuite documentation. Thanks for any help.

Hi Jeffrey,
Assuming you’re using Web 2.0, if you check the LoadButtons method of pgeToolbar in the demo project, you can actually see this done for a few of the buttons in a couple of different ways. The most common way is to create a menu:

dim EditMenuItem as new GraffitiMenuItem( "AddMenu" )
EditMenuItem.Children.Append( new GraffitiMenuItem( "text", "Plain Text" ) )
EditMenuItem.Children.Append( new GraffitiMenuItem( "undo", "Undo", "fa fa-undo", false, "u" ) )
EditMenuItem.Children.Append( new GraffitiMenuItem( True ) )
EditMenuItem.Children.Append( new GraffitiMenuItem( "cut", "Cut", "fa fa-cut", false, "t" ) )
EditMenuItem.Children.Append( new GraffitiMenuItem( "copy", "Copy", "fa fa-copy", false, "c" ) )
EditMenuItem.Children.Append( new GraffitiMenuItem( "paste", "Paste", "fa fa-paste", True, "p" ) )
EditMenuItem.Children.Append( new GraffitiMenuItem( "delete", "Delete", "fa fa-times", false, "d" ) )
EditMenuItem.Children.Append( new GraffitiMenuItem( True ) )
EditMenuItem.Children.Append( new GraffitiMenuItem( "selall", "Select All", "fa fa-i-cursor", false, "s" ) )
EditMenuItem.Children.Append( new GraffitiMenuItem( True ) )

Then call the AddMenu method that accepts a GraffitiToolbarButton parameter which has the following signature:

AddMenu( ToolbarItem as GraffitiToolbarButton, theMenu as GraffitiMenuItem, Trigger as Integer, AutoHide as Boolean = False, Position as REALbasic.Point = nil )

As:

gcmPopups.AddMenu( tlbAdd, EditMenuItem, GraffitiMenu.TriggerHover, True )

In the future, if you open tickets via the Support system, you’ll likely get a quicker answer and will provide me all of the information I need to assist you.

Sweet! Ill give it a shot! Thank you

OOOOH that’s where all the examples are at!!! Glad you pointed that out!

1 Like
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.