How to set the view tooltip's color?

sketchup

#1

I set a tooltip to display the error message in the view.

view.drawing_color = Sketchup::Color.new 'Red' # no effect
view.tooltip = 'test'

How to I set the red color?
color_tooltip


#2

Those tooltips are “real” tooltips, that means they conform to the application’s / operating system’s default. They are currently not customizable.

  • Would your users enjoy tooltips that are different from all other tooltips?
  • What semantics do you want to communicate with the custom color? What is the purpose/use case?

#3

red_penil

  • I write a custom tool, it’s behave just like the built-in line drawing tool.
  • When the user enters the wrong length in the numeric input box, the view tooltip should be displayed in red.

How the built-in tool do it? Where can I find the code or API?


#4

Ok, that’s what you mean!

The built-in tool is not written in Ruby using the Ruby API, but in C++ using internal methods that are not safe and accessible for public use.

You might need to go a step back and adjust your specification .The goal is to give the user feedback about the error. The realization of this goal can be a red tooltip, but there could be alternative solutions. For example you could set the statusbar text to show the error.


#5

… and there is also UI::Notification class for SketchUp 2017+ …


#6

It is bottom left for me, unless I’m using my laptop upside down. :wink:
Again the docu is a little buggy, and left many thing for the user to discover himself…
But at least we have it!! :slight_smile: