[Question]large_icon or relative path
-
Is there a way to get the large_icon or small_icon of an instance of UI::Command?
cmd = UI;;Command.new("Tester") { UI.messagebox("Hello World") } cmd.small_icon = "ToolPencilSmall.png" cmd.large_icon = "ToolPencilLarge.png"command.large_icon does't work!
I have try to modify the instance_method "large_icon=" of UI::Command in a rb file like "c:/Command_.rb".
module UI class Command attr_reader ;large_icon alias_method ;old_large_icon=,;large_icon= def large_icon= (fn) @large_icon=fn old_large_icon=(fn) end end endIt works .
But tool button will be shown without icon if program uses relative path to the icon file.
Like sandboxmenus.rb in "C:/Program Files/Google/Google SketchUp 7/Tools/Sandbox".#a segment of sandboxmenus.rb cmd = UI;;Command.new($tStrings.GetString("From Scratch")) { Sketchup;;active_model.select_tool FromScratchTool.new } cmd.small_icon = "Images/tbFlatTerrainSmall.png" cmd.large_icon = "Images/tbFlatTerrainLarge.png"It seems that "Images/tbFlatTerrainSmall.png" is treated as "c:/Images/tbFlatTerrainSmall.png" instead of "C:/Program Files/Google/Google SketchUp 7/Tools/Sandbox/Images/tbFlatTerrainSmall.png".
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement