MCPcopy Index your code
hub / github.com/rawpython/remi / default_icon

Function default_icon

editor/widgets/__init__.py:5–20  ·  view source on GitHub ↗

A simple function to make a default svg icon for the widgets such icons can be replaced later with a good one

(name, view_w=2, view_h=0.6)

Source from the content-addressed store, hash-verified

3
4
5def default_icon(name, view_w=2, view_h=0.6):
6 """
7 A simple function to make a default svg icon for the widgets
8 such icons can be replaced later with a good one
9 """
10 icon = gui.Svg(width=100,height=30)
11 icon.set_viewbox(-view_w/2,-view_h/2,view_w,view_h)
12 text = gui.SvgText(0,0,name)
13 text.style['font-size'] = "0.2px"
14 text.style['text-anchor'] = "middle"
15 stroke_width = 0.01
16 rect = gui.SvgRectangle(-view_w/2+stroke_width,-view_h/2+stroke_width,view_w-stroke_width*2,view_h-stroke_width*2)
17 rect.set_fill("none")
18 rect.set_stroke(0.01,'black')
19 icon.append([rect, text])
20 return icon
21
22try:
23 from .toolbox_EPICS import EPICSBooleanButton, EPICSLed, EPICSValueMeterWidget, EPICSPlotPV, EPICSValueGaugeWidget

Callers 3

EPICSPlaceholderClass · 0.70
OPENCVPlaceholderClass · 0.70
SIEMENSPlaceholderClass · 0.70

Calls 4

set_viewboxMethod · 0.95
set_fillMethod · 0.45
set_strokeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected