sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    [Question]large_icon or relative path

    Scheduled Pinned Locked Moved Developers' Forum
    1 Posts 1 Posters 246 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W Offline
      wikii
      last edited by

      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
      end
      
      

      It 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".

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement