OriginPro
 
Loading...
Searching...
No Matches
originpro.base.GObject Class Reference
Inheritance diagram for originpro.base.GObject:
originpro.base.BaseObject originpro.base.Label originpro.base.Line

Public Member Functions

 __init__ (self, obj, layer)
 
 remove (self)
 
 color (self)
 
 color (self, rgb)
 
- Public Member Functions inherited from originpro.base.BaseObject
 __del__ (self)
 
 __str__ (self)
 
 __bool__ (self)
 
 index (self)
 
 get_str (self, prop)
 
 get_int (self, prop)
 
 get_float (self, prop)
 
 set_str (self, prop, value)
 
 set_int (self, prop, value)
 
 set_float (self, prop, value)
 
 method_int (self, name, arg='')
 
 method_float (self, name, arg='')
 
 method_str (self, name, arg='')
 
 lt_exec (self, labtalk)
 
 name (self)
 
 name (self, value)
 
 lname (self)
 
 lname (self, value)
 
 comments (self)
 
 comments (self, value)
 
 show (self)
 
 show (self, value)
 
 usertree (self)
 
 usertree (self, tr)
 
 userprops (self)
 

Public Attributes

 layer = layer
 
- Public Attributes inherited from originpro.base.BaseObject
 obj = obj
 

Detailed Description

This class represents an instance of a text object on a GLayer.

Constructor & Destructor Documentation

◆ __init__()

originpro.base.GObject.__init__ ( self,
obj,
layer )

Reimplemented from originpro.base.BaseObject.

Member Function Documentation

◆ color() [1/2]

originpro.base.GObject.color ( self)
Property getter returns the RGB color of the text object as a tuple (Red, Green, Blue)

Parameters:

Returns:
    (tuple) r,g,b

Examples:
    label = g[0].label('text')
    red, green, blue = label.color

◆ color() [2/2]

originpro.base.GObject.color ( self,
rgb )
Property setter for the RGB color of the text object

Parameters:
    rgb(int, str, tuple): various way to specify color, see function ocolor(rgb) in op.utils

Returns:
    None

Examples:
    label = g[0].label('text')
    label.color = 'Red'
    label.color = 3            # 'Green'
    label.color = '#00f'       # 'blue'
    label.color = '#0000ff'    # 'blue'
    label.color = [0, 255, 0]  # 'green'

◆ remove()

originpro.base.GObject.remove ( self)
Deletes label.
Parameters:
    none
Returns:
    None
Examples:
    gl=op.find_graph()[0]
    label = gl.label('xb')
    label.remove()

The documentation for this class was generated from the following file: