Toolbar icon not appear


#1

I made 24 x 24 px png , and put the path as following:
runCode_cmd.small_icon = “C:\Users\user1\RubymineProjects\2016test\testproject\images\Run_plugin_24.png”

but still not appear .

shall the images be in specific folder


#2

Hi,

No it hasn’t to be in a specific folder.

  1. Are you sure that your image path is valid ?
  2. Do you have a default image () loaded into your toolbar or just nothing ?
  3. Can you give us a bit more of your command code ?

#3

yes I have default image loaded into my toolbar


#4

Replace the ‘’ characters by ‘/’ ones in your path, SU is sensible to that :wink:


#5

or let ruby create the path

image_path = File.join(__dir__, "images", "Run_plugin_24.png")
runCode_cmd.small_icon = image_path

john


#6

thanks .it worked fine . problem in the slash direction


#7

Ah yes! In a string in Ruby, a single backslash is the escape character. To get a literal backslash you have to double it. In the end it’s easier to use forward slashes (and its more portable, as only Windows uses backslash for paths!).