|
|
There are other calls that can be used with tooltips. I will just list them with a brief description of what they do.
|
Enable a disabled set of tooltips.
|
Disable an enabled set of tooltips.
|
Sets how many milliseconds you have to hold your pointer over the widget before the tooltip will pop up. The default is 500 milliseconds (half a second).
|
Set the foreground and background color of the tooltips.
And that's all the functions associated with tooltips. More than you'll ever want to know :-)
9.4 Progress Bars
Progress bars are used to show the status of an operation. They are pretty easy to use, as you will see with the code below. But first lets start out with the calls to create a new progress bar.
There are two ways to create a progress bar, one simple that takes no arguments, and one that takes an Adjustment object as an argument. If the former is used, the progress bar creates its own adjustment object.
|
The second method has the advantage that we can use the adjustment object to specify our own range parameters for the progress bar.
The adjustment of a progress object can be changed dynamically using:
|
Now that the progress bar has been created we can use it.
|
The first argument is the progress bar you wish to operate on, and the second argument is the amount "completed", meaning the amount the progress bar has been filled from 0-100%. This is passed to the function as a real number ranging from 0 to 1.
GTK v1.2 has added new functionality to the progress bar that enables it to display its value in different ways, and to inform the user of its current value and its range.
A progress bar may be set to one of a number of orientations using the function
|
The orientation argument may take one of the following values to indicate the direction in which the progress bar moves:
GTK_PROGRESS_LEFT_TO_RIGHT
GTK_PROGRESS_RIGHT_TO_LEFT
GTK_PROGRESS_BOTTOM_TO_TOP
GTK_PROGRESS_TOP_TO_BOTTOM
When used as a measure of how far a process has progressed, the ProgressBar can be set to display its value in either a continuous or discrete mode. In continuous mode, the progress bar is updated for each value. In discrete mode, the progress bar is updated in a number of discrete blocks. The number of blocks is also configurable.
The style of a progress bar can be set using the following function.
|
The style parameter can take one of two values:
GTK_PROGRESS_CONTINUOUS
GTK_PROGRESS_DISCRETE
The number of discrete blocks can be set by calling
|
推荐文章
精彩文章
|