Custom widgets.
Bases: gi.overrides.Gtk.Button
Constructors: |
---|
Button(**properties)
new()
new_from_icon_name(icon_name:str, size:int)
new_from_stock(stock_id:str)
new_with_label(label:str)
new_with_mnemonic(label:str)
Bases: gi.overrides.Gtk.Button
Constructors: |
---|
Button(**properties)
new()
new_from_icon_name(icon_name:str, size:int)
new_from_stock(stock_id:str)
new_with_label(label:str)
new_with_mnemonic(label:str)
Bases: gi.overrides.Gtk.Button
Constructors: |
---|
Button(**properties)
new()
new_from_icon_name(icon_name:str, size:int)
new_from_stock(stock_id:str)
new_with_label(label:str)
new_with_mnemonic(label:str)
Bases: object
Bases: gi.repository.Gtk.DrawingArea
Constructors: |
---|
DrawingArea(**properties)
new()
determine red, green, blue value of background of the box of person, which has gender gender, and is in ring generation
Create a 2D-transform, mapping a rectangle onto a circle sector.
Parameters: |
|
---|---|
Returns: | a lambda (x,y)|->(xNew,yNew) to feed to warpPath. |
GTK3 uses width for height sizing model. This method will override the virtual method
GTK3 uses width for height sizing model. This method will override the virtual method
Display text at a particular radius, between start and stop degrees, setting it up along the arc, center-justified.
Text not fitting a single line will be word-wrapped away.
Procedure to draw a person in the inner ring position
Display text at a particular radius, between start and stop degrees.
The font should be bold if no transparency and font is set. In that case, True is returned
Returned parameters after drag. Specified for ‘person-link’, for others return text info about person.
Handle the standard gtk interface for drag_data_received.
If the selection data is defined, extract the value from sel_data.data
Determine the generation and the position in the generation at position x and y, as well as the type of box. generation = -1 on center black dot generation >= self.generations outside of diagram
returns the person in generation generation at angle of type btype.
Bases: gramps.gui.widgets.fanchart.FanChartBaseWidget
Constructors: |
---|
DrawingArea(**properties)
new()
Display the piece of pie for a given person. start and stop are in degrees. Gender is indication of father position or mother position in the chart
returns the family at generation, pos, btype Difficult here, we would need to go to child, and then obtain the first parent family, as that is the family that is shown.
The main method to do the drawing. If widget is given, we assume we draw in GTK3 and use the allocation. To draw raw on the cairo context cr, set widget=None.
returns the person in generation generation at angle.
Reset the values to be used:
Parameters: |
|
---|
Bases: object
class for functions fanchart GUI elements will need in Gramps
Renders the person data into some lines of text and puts that into the clipboard
Bases: gramps.gui.widgets.fanchart.FanChartBaseWidget
Constructors: |
---|
DrawingArea(**properties)
new()
Display the piece of pie for a given person. start_rad and slice are in radial.
The main method to do the drawing. If widget is given, we assume we draw in GTK3 and use the allocation. To draw raw on the cairo context cr, set widget=None.
returns the person in generation generation at angle.
Reset the values to be used:
Parameters: |
|
---|
Bases: gramps.gui.widgets.fanchart.FanChartGrampsGUI
class for functions fanchart GUI elements will need in Gramps
Module that implements the gramplet bar fuctionality.
Bases: gramps.gui.managedwindow.ManagedWindow
Class for showing a detached gramplet.
Part of the Gramps window interface.
Bases: gi.repository.Gtk.Notebook
Constructors: |
---|
Notebook(**properties)
new()
Bases: gi.overrides.Gtk.ScrolledWindow, gramps.gui.widgets.grampletpane.GuiGramplet
Constructors: |
---|
ScrolledWindow(**properties)
new(hadjustment:Gtk.Adjustment=None, vadjustment:Gtk.Adjustment=None)
GrampletView interface.
Bases: gi.repository.Gtk.TextTag
Constructors: |
---|
TextTag(**properties)
new(name:str=None)
Bases: gramps.gui.managedwindow.ManagedWindow
Class for showing a detached gramplet.
Part of the GRAMPS window interface.
Bases: object
Class that handles the GUI representation of a Gramplet.
Bases: gramps.gui.widgets.grampletpane.GuiGramplet
Class that handles the plugin interfaces for the GrampletView.
Bases: gi.overrides.Gtk.ScrolledWindow
Constructors: |
---|
ScrolledWindow(**properties)
new(hadjustment:Gtk.Adjustment=None, vadjustment:Gtk.Adjustment=None)
This is the destination method for handling drag and drop of a gramplet onto the main scrolled window. Also used for adding new gramplets, then context should be GridGramplet
Bases: gi.repository.Gtk.EventBox
Constructors: |
---|
EventBox(**properties)
new()
Bases: gi.repository.Gtk.HBox
Constructors: |
---|
HBox(**properties)
new(homogeneous:bool, spacing:int)
Bases: gi.overrides.Gtk.Label
Constructors: |
---|
Label(**properties)
new(str:str=None)
new_with_mnemonic(str:str=None)
Bases: gi.overrides.Gtk.Label
Constructors: |
---|
Label(**properties)
new(str:str=None)
new_with_mnemonic(str:str=None)
Bases: object
Bases: object
Bases: gramps.gui.widgets.monitoredwidgets.MonitoredEntry
Show an Entry box with an indicator in it that disappears when entry becomes active
Bases: object
Class for signal handling of spinbuttons. (Code is a modified copy of MonitoredEntry)
Connect the signal of monitored widget to the specified callback.
Parameters: |
|
---|
Change the property editable and sensitive of the monitored widget to value.
Parameters: | value (bool) – If widget should be editable or deactivated. |
---|
Set the value of the monitored widget to the specified value.
Parameters: | value – Value to be set. |
---|
Get the current value of the monitored widget.
Returns: | Current value of monitored widget. |
---|
Reinitialize class with the specified callback functions.
Parameters: |
|
---|
Bases: object
Bases: object
Bases: object
Bases: object
Bases: object
Bases: object
Class that associates a pixmap with a text widget, providing visual feedback that indicates if the text widget contains a valid date.
Bases: object
A MonitoredEntry driven by a Combobox to select what the entry field works upon
callback for change on the combo, change active iter, update associated entrybox
An override to allow easy multiselections.
This module provides a progress dialog for displaying the status of long running operations.
Bases: gramps.gen.utils.callback.Callback
LongOpStatus provides a way of communicating the status of a long running operations. The intended use is that when a long running operation is about to start it should create an instance of this class and emit it so that any listeners can pick it up and use it to record the status of the operation.
Signals
Example usage:
class MyClass(Callback):
__signals__ = {
'op-start' : object
}
def long(self):
status = LongOpStatus("doing long job", 100, 10)
for i in xrange(0,99):
time.sleep(0.1)
status.heartbeat()
status.end()
class MyListener(object):
def __init__(self):
self._op = MyClass()
self._op.connect('op-start', self.start)
self._current_op = None
def start(self,long_op):
self._current_op.connect('op-heartbeat', self.heartbeat)
self._current_op.connect('op-end', self.stop)
def hearbeat(self):
# update status display
def stop(self):
# close the status display
self._current_op = None
Return the number of seconds estimated left before operation completes. This will change as ‘hearbeat’ is called.
Returns: | estimated seconds to complete. |
---|---|
Return type: | int |
Get the interval between ‘op-hearbeat’ signals.
Returns: | the interval between ‘op-hearbeat’ signals. |
---|---|
Return type: | int |
Get to total number of steps. NOTE: this is not the number of times that the ‘op-heartbeat’ message will be emited. ‘op-heartbeat’ is emited get_total_steps/interval times.
Returns: | total number of steps. |
---|---|
Return type: | int |
This should be called for each step in the operation. It will emit a ‘op-heartbeat’ every ‘interval’ steps. It recalcuates the ‘estimated_secs_to_complete’ from the time taken for previous steps.
Set the current description message.
Parameters: | msg (string) – The description message. |
---|
Return true of the user has asked for the operation to be cancelled.
Returns: | True of the operation should be cancelled. |
---|---|
Return type: | bool |
Bases: object
A dialog for displaying the status of long running operations.
It will work with LongOpStatus objects to track the progress of long running operations. If the operations is going to take longer than popup_time it will pop up a dialog with a progress bar so that the user gets some feedback about what is happening.
Add a new status object to the progress dialog.
Parameters: | op_status (LongOpStatus) – the status object. |
---|
Bases: gi.overrides.Gtk.Dialog
Constructors: |
---|
Dialog(**properties)
new()
Add a new status object to the progress dialog.
Parameters: | long_op_status (LongOpStatus) – the status object. |
---|---|
Returns: | a key that can be used as the pbar_idx to the other methods. |
Return type: | int |
ShortlistComboEntry class.
Bases: gramps.gui.widgets.validatedcomboentry.ValidatedComboEntry
Constructors: |
---|
ComboBox(**properties)
new()
new_with_area(area:Gtk.CellArea)
new_with_area_and_entry(area:Gtk.CellArea)
new_with_entry()
new_with_model(model:Gtk.TreeModel)
new_with_model_and_entry(model:Gtk.TreeModel)
Separator classes used for Toolbar.
Text buffer subclassed from Gtk.TextBuffer handling StyledText.
Bases: gi.repository.Gtk.TextTag
Constructors: |
---|
TextTag(**properties)
new(name:str=None)
Bases: object
A simple state machine kinda thingy.
Trying to track Gtk.Spell activities on a buffer and re-apply formatting after Gtk.Spell replaces a misspelled word.
Gtk.Spell style Gtk.TextIter.backward_word_start.
The parameter ‘iter’ is changing as side effect.
Gtk.Spell style Gtk.TextIter.forward_word_end.
The parameter ‘iter’ is changing as side effect.
Bases: gramps.gui.widgets.undoablebuffer.UndoableBuffer
Constructors: |
---|
TextBuffer(**properties)
new(table:Gtk.TextTagTable=None)
Apply a style with the given value to the selection.
Parameters: |
|
---|
Get the actual value of the given style at the cursor position.
Parameters: | style (StyledTextTagStyle int value) – style type to apply |
---|---|
Returns: | value of the style type |
Return type: | depends on the style type |
Return the buffer text.
Note
s_ prefix means StyledText*, while g_ prefix means Gtk.*.
Text editor subclassed from Gtk.TextView handling StyledText.
Bases: gi.repository.Gtk.TextView
Constructors: |
---|
TextView(**properties)
new()
new_with_buffer(buffer:Gtk.TextBuffer)
Default signal handler.
URL highlighting.
Parameters: | match (tuple or None) – the new match parameters |
---|
Warning
Do not override the handler, but connect to the signal.
Get the text of the text buffer of the editor.
Returns: | the formatted text from the editor. |
---|---|
Return type: | StyledText |
Get the formatting toolbar of the editor.
Returns: | toolbar widget to use as formatting GUI. |
---|---|
Return type: | Gtk.Toolbar |
Return a string useful for a tooltip given a LinkTag object.
Signal handler.
Handles the <CTRL> + Left click over a URL match.
Copy selection to clipboard for left click if selection given
Signal handler.
As the mouse cursor moves the handler checks if there’s a new regexp match at the new location. If match changes the ‘match-changed’ signal is raised.
Signal handler.
Insert extra menuitems:
Set the text of the text buffer of the editor.
Parameters: | text (StyledText) – formatted text to edit in the view. |
---|
ToolComboEntry class.
gtk textbuffer with undo functionality
Bases: list
Very simple stack implementation that cannot grow beyond an at init determined size. Inherits from list. Only append checks if this is really the case!
Bases: object
something that has been inserted into our textbuffer
Bases: object
something that has been deleted from our textbuffer
Bases: gi.overrides.Gtk.TextBuffer
Constructors: |
---|
TextBuffer(**properties)
new(table:Gtk.TextTagTable=None)
alias of UndoableDelete
alias of UndoableInsert
Bases: object
something that has been inserted into our Gtk.editable
Bases: object
something that has been deleted from our textbuffer
Bases: gi.repository.Gtk.Entry
Constructors: |
---|
Entry(**properties)
new()
new_with_buffer(buffer:Gtk.EntryBuffer)
alias of UndoableDeleteEntry
alias of UndoableInsertEntry
gtk textbuffer with undo functionality
Bases: gramps.gui.widgets.undoablebuffer.UndoableInsert
something that has been inserted into our styledtextbuffer
a style has been applied to our textbuffer
Bases: gramps.gui.widgets.styledtextbuffer.StyledTextBuffer
Constructors: |
---|
TextBuffer(**properties)
new(table:Gtk.TextTagTable=None)
alias of UndoableDeleteStyled
alias of UndoableInsertStyled
The ValidatedComboEntry widget class.
Bases: gi.overrides.Gtk.ComboBox
Constructors: |
---|
ComboBox(**properties)
new()
new_with_area(area:Gtk.CellArea)
new_with_area_and_entry(area:Gtk.CellArea)
new_with_entry()
new_with_model(model:Gtk.TreeModel)
new_with_model_and_entry(model:Gtk.TreeModel)
Bases: gi.overrides.GObject.Object
Constructors: |
---|
Object(**properties)
new(object_type:GType, parameters:list)
Bases: gramps.gui.widgets.undoableentry.UndoableEntry
Constructors: |
---|
Entry(**properties)
new()
new_with_buffer(buffer:Gtk.EntryBuffer)
Get the empty mask between start and end
Parameters: |
|
---|---|
Returns: | mask |
Return type: | string |
Get the fields assosiated with the entry. A field is dynamic content separated by static. For example, the format string 000-000 has two fields separated by a dash. if a field is empty it’ll return an empty string otherwise it’ll include the content
Returns: | fields |
---|---|
Return type: | list of strings |
Set the way how completion is presented.
Parameters: |
|
---|
Enable exact entry completion. Exact means it needs to start with the value typed and the case needs to be correct.
Parameters: | value (boolean) – enable exact completion |
---|
Set the mask of the Entry.
Supported format characters are:
- ‘0’ digit
- ‘L’ ascii letter (a-z and A-Z)
- ‘&’ alphabet, honors the locale
- ‘a’ alphanumeric, honors the locale
- ‘A’ alphanumeric, honors the locale
This is similar to MaskedTextBox: http://msdn2.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.mask(VS.80).aspx
Example mask for a ISO-8601 date >>> entry.set_mask(‘0000-00-00’)
Parameters: | mask – the mask to set |
---|
Bases: gramps.gui.widgets.validatedmaskedentry.MaskedEntry
Constructors: |
---|
Entry(**properties)
new()
new_with_buffer(buffer:Gtk.EntryBuffer)
Change the validation state to blank state, this only applies for mandatory widgets, draw an icon and set a tooltip
Set default message for validation error.
Default error message for an instance is useful when completion is used, because this case custom validation is not called.
Parameters: | text (str) – can contain one and only one ‘%s’, where the actual value of the Entry will be inserted. |
---|
Change the validation state to invalid.
Parameters: |
|
---|
ValueAction class.
Bases: gi.overrides.Gtk.Action
Constructors: |
---|
Action(**properties)
new(name:str, label:str=None, tooltip:str=None, stock_id:str=None)
Connect a widget to an action object as a proxy.
Parameters: | proxy (ValueToolItem subclass) – widget to be connected |
---|
Default signal handler for ‘changed’ signal.
Synchronize all the proxies with the active value.
Create a ‘default’ toolbar item widget.
Override the default method, to be able to pass the required parameters to the proxy’s constructor.
This method is called from Gtk.UIManager.ensure_update(), when a ‘toolitem’ is found in the UI definition with a name refering to a ValueAction. Thus, to use the action via the UIManager a ‘default’ toolitem type has to be set with the Gtk.Action.set_tool_item_type() method, before invoking the Gtk.UIManager.ensure_update() method.
Widgets other than the default type has to be created and added manually with the Gtk.Action.connect_proxy() method.
Returns: | a toolbar item connected to the action. |
---|---|
Return type: | ValueToolItem subclass |
ValueToolItem class.