Hello,
I was using Label controls on top of drawable buttons until I realize the label controls steal cursor focus from the drawable button.
I now am attempting to draw the “label text” within the drawable itself but cannot get it to show the text despite it seemingly being correct (to me) in code.
Here’s a little pill shape drawable:
e.Graphics.DrawImage(self.icon_hover if self._hover else (self.icon_light if dark_mode else self.icon_dark), self._i_rect) # Draw Icon
e.Graphics.DrawPath(self._b_pen_2 if self._state and not self._hover else (self._h_pen if self._hover else self._b_pen), self._h_path) # Draws The Outline Graphics
label_font = Eto.Drawing.Font("Arial", 10, Eto.Drawing.FontStyle.NONE, Eto.Drawing.FontDecoration.NONE)
Rhino.RhinoApp.WriteLine(label_font)
e.Graphics.DrawText((Eto.Drawing.Font(label_font, fg_color_light if dark_mode else fg_color_dark, self.c_text)), Eto.Drawing.PointF(self.Bounds.Width / 2, self.Bounds.Height / 2))
You can see I am drawing the image icon to the left, the “color hover” path around the pill shape and then I am expecting to see text showing up as well but no luck there.
Could someone please help with some guidance on how to use DrawText in a drawable?
When I print out the “label_font” I do get a valid text object as expected but I cannot get to visually show up.
Thank you for your response!