File: class-gtkmessagedialog.html

package info (click to toggle)
python-gtk2-doc 2.5.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,304 kB
  • ctags: 3,741
  • sloc: makefile: 38
file content (79 lines) | stat: -rw-r--r-- 16,806 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.MessageDialog</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="previous" href="class-gtkmenutoolbutton.html" title="gtk.MenuToolButton"><link rel="next" href="class-gtkmisc.html" title="gtk.Misc"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.MessageDialog</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkmenutoolbutton.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkmisc.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkmessagedialog"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.MessageDialog</h2><p>gtk.MessageDialog &#8212; a convenient message window</p></div><div class="refsect1" lang="en"><a name="id3468840"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.MessageDialog</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtkdialog.html" title="gtk.Dialog">gtk.Dialog</a></span></span>):
<code class="constructorsynopsis">    <span class="methodname"><a href="class-gtkmessagedialog.html#constructor-gtkmessagedialog" title="Constructor">gtk.MessageDialog</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>parent</tt></b></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>flags</tt></b></span><span class="initializer">=0</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</tt></b></span><span class="initializer">=gtk.MESSAGE_INFO</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>buttons</tt></b></span><span class="initializer">=gtk.BUTTONS_NONE</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>message_format</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkmessagedialog.html#method-gtkmessagedialog--set-markup" title="gtk.MessageDialog.set_markup">set_markup</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>str</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkmessagedialog.html#method-gtkmessagedialog--format-secondary-text" title="gtk.MessageDialog.format_secondary_text">format_secondary_text</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>message_format</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkmessagedialog.html#method-gtkmessagedialog--format-secondary-markup" title="gtk.MessageDialog.format_secondary_markup">format_secondary_markup</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>message_format</tt></b></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3468993"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
  +-- <a href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
    +-- <a href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
      +-- <a href="class-gtkcontainer.html" title="gtk.Container">gtk.Container</a>
        +-- <a href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a>
          +-- <a href="class-gtkwindow.html" title="gtk.Window">gtk.Window</a>
            +-- <a href="class-gtkdialog.html" title="gtk.Dialog">gtk.Dialog</a>
              +-- <a href="class-gtkmessagedialog.html" title="gtk.MessageDialog">gtk.MessageDialog</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3469054"></a><h2>Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"buttons"</td><td valign="top">Write-Construct</td><td valign="top">The buttons shown in the message dialog. One of the
<a href="gtk-constants.html#gtk-buttons-type-constants">GTK Buttons Type Constants</a>:
<tt class="literal">gtk.BUTTONS_NONE</tt>,
<tt class="literal">gtk.BUTTONS_OK</tt>,
<tt class="literal">gtk.BUTTONS_CLOSE</tt>,
<tt class="literal">gtk.BUTTONS_CANCEL</tt>,
<tt class="literal">gtk.BUTTONS_YES_NO</tt>,
<tt class="literal">gtk.BUTTONS_OK_CANCEL</tt>. Default value:
<tt class="literal">gtk.BUTTONS_NONE</tt></td></tr><tr valign="top"><td valign="top">"message-type"</td><td valign="top">Read-Write-Construct</td><td valign="top">The type of message. One of the
<a href="gtk-constants.html#gtk-message-type-constants">GTK Message Type Constants</a>:
<tt class="literal">gtk.MESSAGE_INFO</tt>, <tt class="literal">gtk.MESSAGE_WARNING</tt>,
<tt class="literal">gtk.MESSAGE_QUESTION</tt> or
<tt class="literal">gtk.MESSAGE_ERROR</tt>. Default value:
<tt class="literal">gtk.MESSAGE_INFO</tt></td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3469202"></a><h2>Style Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"message-border"</td><td valign="top">Read-Write</td><td valign="top">The width of border around the label and image in the
message dialog. Allowed values: &gt;= 0. Default value: 12.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3469274"></a><h2>Attributes</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table cellpadding="5" width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"image"</td><td valign="top">Read</td><td valign="top">The stock ID image</td></tr><tr valign="top"><td valign="top">"label"</td><td valign="top">Read</td><td valign="top">The label widget that contains the message
text.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3469364"></a><h2>Description</h2><p>The <a href="class-gtkmessagedialog.html" title="gtk.MessageDialog"><tt class="classname">gtk.MessageDialog</tt></a> 
presents a dialog with an image representing the type of message (Error,
Question, etc.) alongside some message text. It's simply a convenience
widget; you could construct the equivalent of <a href="class-gtkmessagedialog.html" title="gtk.MessageDialog"><tt class="classname">gtk.MessageDialog</tt></a> 
from <a href="class-gtkdialog.html" title="gtk.Dialog"><tt class="classname">gtk.Dialog</tt></a> without
too much effort, but <a href="class-gtkmessagedialog.html" title="gtk.MessageDialog"><tt class="classname">gtk.MessageDialog</tt></a> 
saves time.</p><p>The <a href="class-gtkmessagedialog.html" title="gtk.MessageDialog"><tt class="classname">gtk.MessageDialog</tt></a>
types are listed in the <a href="gtk-constants.html#gtk-message-type-constants">GTK Message Type Constants</a>.</p><p>A selection of predefined button sets is available for use in a
message dialog. See the <a href="gtk-constants.html#gtk-buttons-type-constants">GTK Buttons Type Constants</a>.</p><p>See the <a href="class-gtkdialog.html" title="gtk.Dialog"><tt class="classname">gtk.Dialog</tt></a> reference
page for additional methods to be used with the <a href="class-gtkmessagedialog.html" title="gtk.MessageDialog"><tt class="classname">gtk.MessageDialog</tt></a>.</p></div><div class="refsect1" lang="en"><a name="constructor-gtkmessagedialog"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.MessageDialog</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>parent</tt></b></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>flags</tt></b></span><span class="initializer">=0</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</tt></b></span><span class="initializer">=gtk.MESSAGE_INFO</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>buttons</tt></b></span><span class="initializer">=gtk.BUTTONS_NONE</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>message_format</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>parent</tt></b>:</span></td><td>the transient parent, or None if
none</td></tr><tr><td><span class="term"><b class="parameter"><tt>flags</tt></b>:</span></td><td>the dialog flags - a combination of:
<tt class="literal">gtk.DIALOG_MODAL</tt>,
<tt class="literal">gtk.DIALOG_DESTROY_WITH_PARENT</tt> or 0 for no
flags</td></tr><tr><td><span class="term"><b class="parameter"><tt>type</tt></b>:</span></td><td>the type of message:
<tt class="literal">gtk.MESSAGE_INFO</tt>, <tt class="literal">gtk.MESSAGE_WARNING</tt>,
<tt class="literal">gtk.MESSAGE_QUESTION</tt> or
<tt class="literal">gtk.MESSAGE_ERROR</tt>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>buttons</tt></b>:</span></td><td>the predefined set of buttons to use:
<tt class="literal">gtk.BUTTONS_NONE</tt>, <tt class="literal">gtk.BUTTONS_OK</tt>,
<tt class="literal">gtk.BUTTONS_CLOSE</tt>, <tt class="literal">gtk.BUTTONS_CANCEL</tt>,
<tt class="literal">gtk.BUTTONS_YES_NO</tt>,
<tt class="literal">gtk.BUTTONS_OK_CANCEL</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>message_format</tt></b>:</span></td><td>a string containing the message text or
None</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gtkmessagedialog.html" title="gtk.MessageDialog"><tt class="classname">gtk.MessageDialog</tt></a> 
widget</td></tr></tbody></table><p>Creates a new <a href="class-gtkmessagedialog.html" title="gtk.MessageDialog"><tt class="classname">gtk.MessageDialog</tt></a>, 
which is a simple dialog with an icon indicating the dialog type (error,
warning, etc.) specified by <i class="parameter"><tt>type</tt></i> and some text
(<i class="parameter"><tt>message_format</tt></i>) the user may want to see.
<i class="parameter"><tt>parent</tt></i> if specified indicates the transient parent of
the dialog. The <i class="parameter"><tt>flags</tt></i> allow the specification special
dialog characteristics: make the dialog modal
(<tt class="literal">gtk.DIALOG_MODAL</tt>) and destroy the dialog when the parent is
destroyed (<tt class="literal">gtk.DIALOG_DESTROY_WITH_PARENT</tt>). When the user
clicks a button a "response" signal is emitted with response IDs.
<i class="parameter"><tt>buttons</tt></i> specifies the set of predefined buttons to
use: <tt class="literal">gtk.BUTTONS_NONE</tt>, <tt class="literal">gtk.BUTTONS_OK</tt>,
<tt class="literal">gtk.BUTTONS_CLOSE</tt>, <tt class="literal">gtk.BUTTONS_CANCEL</tt>,
<tt class="literal">gtk.BUTTONS_YES_NO</tt>,
<tt class="literal">gtk.BUTTONS_OK_CANCEL</tt>. See <a href="class-gtkdialog.html" title="gtk.Dialog"><tt class="classname">gtk.Dialog</tt></a> for more
details.</p></div><div class="refsect1" lang="en"><a name="id3469767"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkmessagedialog--set-markup"></a><h3>gtk.MessageDialog.set_markup</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_markup</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>str</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>str</tt></b>:</span></td><td>a markup string (see the <a href="pango-markup-language.html" title="The Pango Markup Language">Pango markup language</a>
      reference)</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">set_markup</tt>() method sets the text
of the message dialog to the contents of <i class="parameter"><tt>str</tt></i>. If
<i class="parameter"><tt>str</tt></i> contains text marked up with Pango markup (see
<a href="pango-markup-language.html" title="The Pango Markup Language">The Pango Markup Language</a>), it will be displayed with
those attributes. Note the '&lt;', '&gt;' and '&amp;' characters must be
replaced with '&amp;lt;', '&amp;gt;' and '&amp;amp;' respectively to be
displayed literally.</p></div><div class="refsect2" lang="en"><a name="method-gtkmessagedialog--format-secondary-text"></a><h3>gtk.MessageDialog.format_secondary_text</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">format_secondary_text</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>message_format</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>message_format</tt></b>:</span></td><td>The text to be displayed as the secondary text
or <tt class="literal">None</tt>.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">format_secondary_text</tt>() method sets
the secondary text of the message dialog to the text specified by
<i class="parameter"><tt>message_format</tt></i>. Note that setting a secondary text
makes the primary text bold, unless you have provided explicit
markup.</p></div><div class="refsect2" lang="en"><a name="method-gtkmessagedialog--format-secondary-markup"></a><h3>gtk.MessageDialog.format_secondary_markup</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">format_secondary_markup</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>message_format</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>message_format</tt></b>:</span></td><td>A string containing the pango markup to use as
secondary text.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">format_secondary_markup</tt>() method
sets the secondary text to the markup text specified by
<i class="parameter"><tt>message_format</tt></i>. Note that setting a secondary text
makes the primary text become bold, unless you have provided explicit
markup.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtkmenutoolbutton.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="class-gtkmisc.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.MenuToolButton</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.Misc</td></tr></table></div></body></html>