wxRuby Documentation Home

# Wx::TipProvider

This is the class used together with ShowTip function.
It must implement get_tip function and return the
current tip from it (different tip each time it is called).

You will never use this class yourself, but you need it to show startup tips
with ShowTip. Also, if you want to get the tips text from elsewhere than a
simple text file, you will want to derive a new class from TipProvider and
use it instead of the one returned by CreateFileTipProvider.

## Derived from

None.

## See also

Startup tips overview, ::ShowTip

## Methods

- TipProvider.new
- TipProvider#get_tip
- TipProvider#preprocess_tip
- CurrentTipProvider#get_current_tip

### TipProvider.new

TipProvider.new(%(arg-type)Integer% currentTip)

Constructor.

- currentTip The starting tip index.

### TipProvider#get_tip

String get_tip()

Return the text of the current tip and pass to the next one. This function is
pure virtual, it should be implemented in the derived classes.

### TipProvider#preprocess_tip

String pre_process_tip(%(arg-type)String% tip)

Returns a modified tip. This function will be called immediately after read,
and before being check whether it is a comment, an empty string or a string
to translate. You can optionally override this in your custom user-derived class
to optionally to modify the tip as soon as it is read. You can return any
modification to the string. If you return EmptyString, then this tip is
skipped, and the next one is read.

### CurrentTipProvider#get_current_tip

Integer get_current_tip()

Returns the index of the current tip (i.e. the one which would be returned by
GetTip).

The program usually remembers the value returned by this function after calling
ShowTip. Note that it is not the same as the value which
was passed to ShowTip $+ 1$ because the user might have pressed the “Next”
button in the tip dialog.

[This page automatically generated from the Textile source at 2023-06-09 00:45:27 +0000]