sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Question]large_icon or relative path

    Scheduled Pinned Locked Moved Developers' Forum
    1 Posts 1 Posters 230 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