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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>gtkmm: Gtk::Main Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div class="navpath"><a class="el" href="namespaceGtk.html">Gtk</a>::<a class="el" href="classGtk_1_1Main.html">Main</a>
</div>
</div>
<div class="contents">
<h1>Gtk::Main Class Reference</h1><!-- doxytag: class="Gtk::Main" --><!-- doxytag: inherits="sigc::trackable" -->
<p><a class="el" href="classGtk_1_1Main.html" title="Main application class Every application must have one of these objects.">Main</a> application class Every application must have one of these objects. <a href="#_details">More...</a></p>
<p>Inherits <a class="elRef" doxygen="libsigc++-2.0.tag:http://library.gnome.org/devel/libsigc++/unstable/" href="http://library.gnome.org/devel/libsigc++/unstable/structsigc_1_1trackable.html">sigc::trackable</a>.</p>
<div class="dynheader">
Collaboration diagram for Gtk::Main:</div>
<div class="dynsection">
<div class="center"><img src="classGtk_1_1Main__coll__graph.png" border="0" usemap="#Gtk_1_1Main_coll__map" alt="Collaboration graph"/></div>
<map name="Gtk_1_1Main_coll__map" id="Gtk_1_1Main_coll__map">
<area shape="rect" doxygen="libsigc++-2.0.tag:http://library.gnome.org/devel/libsigc++/unstable/" href="http://library.gnome.org/devel/libsigc++/unstable/structsigc_1_1trackable.html" title="sigc::trackable" alt="" coords="5,5,112,35"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="classGtk_1_1Main-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#afbc89daf89de698660ce02426967e135">Main</a> (int& argc, char**& argv, <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionContext.html">Glib::OptionContext</a>& option_context)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Scans the argument vector, and strips off all parameters parsed by GTK+ or your <em>option_context</em>. <a href="#afbc89daf89de698660ce02426967e135"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#ae02744d26abd4abfe106ed31f05ad2dc">Main</a> (int* argc, char*** argv, bool set_locale=true)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Scans the argument vector, and strips off all parameters known to GTK+. <a href="#ae02744d26abd4abfe106ed31f05ad2dc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a2b7340ad84fe8d66bb7489c635e8fd5e">Main</a> (int& argc, char**& argv, bool set_locale=true)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">See <a class="el" href="classGtk_1_1Main.html#ae02744d26abd4abfe106ed31f05ad2dc" title="Scans the argument vector, and strips off all parameters known to GTK+.">Main(int* argc, char*** argv, bool set_locale)</a>. <a href="#a2b7340ad84fe8d66bb7489c635e8fd5e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a485eeb37361615a021ca21fb2a6f257c">~Main</a> ()</td></tr>
<tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classGtk_1_1Main.html">Gtk::Main</a>* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a94b74eb618f4b0d213c79c2ada927446">instance</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Access to the one global instance of <a class="el" href="classGtk_1_1Main.html" title="Main application class Every application must have one of these objects.">Gtk::Main</a>. <a href="#a94b74eb618f4b0d213c79c2ada927446"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a6a8904c35952006d13cb07c1d0c16c10">run</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Start the event loop. <a href="#a6a8904c35952006d13cb07c1d0c16c10"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#aaa2e4e282834cbe2d789fe34c447a0dd">run</a> (<a class="el" href="classGtk_1_1Window.html">Window</a>& window)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns from the main loop when the window is closed. <a href="#aaa2e4e282834cbe2d789fe34c447a0dd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a8719a8ac37ff6bb66048ca8967dbd782">quit</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Makes the innermost invocation of the main loop return when it regains control. <a href="#a8719a8ac37ff6bb66048ca8967dbd782"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static guint </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a78f66b89dbe811cdce075a8b00c8987a">level</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a16e384f8b3a02af8d3e86f59053b218e">add_gtk_option_group</a> (<a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionContext.html">Glib::OptionContext</a>& option_context, bool open_default_display=true)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionGroup.html">Glib::OptionGroup</a>, for the commandline arguments recognized by GTK+ and GDK, to a <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionContext.html">Glib::OptionContext</a>, so that these commandline arguments will be processed in addition to the existing commandline arguments specified by the <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionContext.html">Glib::OptionContext</a>. <a href="#a16e384f8b3a02af8d3e86f59053b218e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#ab9ba7993ef8a22b6bf8796a2e4862e68">iteration</a> (bool blocking=true)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Runs a single iteration of the main loop. <a href="#ab9ba7993ef8a22b6bf8796a2e4862e68"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a2a2a6cddef82f8c52026790f3f7887e0">events_pending</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Checks if any events are pending. <a href="#a2a2a6cddef82f8c52026790f3f7887e0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static RunSig& </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#aec1562f7b2a23858472aa94d23b66173">signal_run</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Run signal. <a href="#aec1562f7b2a23858472aa94d23b66173"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static QuitSig& </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#ac1b6ae5b79cb84158f3caf3e9382492d">signal_quit</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Quit signal You can connect signal handlers to invoke actions when <a class="el" href="classGtk_1_1Main.html#a8719a8ac37ff6bb66048ca8967dbd782" title="Makes the innermost invocation of the main loop return when it regains control.">Gtk::Main::quit()</a> has been called. <a href="#ac1b6ae5b79cb84158f3caf3e9382492d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static KeySnooperSig& </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#ab4c316c0789dfb4ab7926e062196c4e5">signal_key_snooper</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">KeySnooper signal Allows you to channel keypresses to a signal handler without registering with the widget. <a href="#ab4c316c0789dfb4ab7926e062196c4e5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#aab3b3f72ad21e91e4c644ee5131d4058">init_gtkmm_internals</a> ()</td></tr>
<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a8a5748d38300e0484a8cf7c756af8c99">Main</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a6f855eae235b700e2242fb68252dcea5">init</a> (int* argc, char*** argv, bool set_locale)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a2642c570bde971015f97b97cce743f80">run_impl</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a785e09dce370a1c5260885ced9efb4a6">quit_impl</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual guint </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#aad90e366d331016ce5ff68023f214d8b">level_impl</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a681a82f7118d71188e64ba9379bb33e7">iteration_impl</a> (bool blocking)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a4a8ca03d685b708e9dc38e3ddaa0875a">events_pending_impl</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a7c3bb918c54342b71e9e56d999b4dd4e">on_window_hide</a> ()</td></tr>
<tr><td colspan="2"><h2>Static Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static RunSig </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a459e2ec96368ff1c28f351496c3200d6">signal_run_</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static QuitSig </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#aee8ba380608053d85a98847eaeb564da">signal_quit_</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static KeySnooperSig </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1Main.html#a97582880bbb0ac12e957861a7ed165a3">signal_key_snooper_</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p><a class="el" href="classGtk_1_1Main.html" title="Main application class Every application must have one of these objects.">Main</a> application class Every application must have one of these objects. </p>
<p>It may not be global and must be the first <a class="el" href="namespaceGtk.html">Gtk</a> object created. It is a singleton so declaring more than one will simply access the first created.</p>
<p>Normal use of this class is in the main() function to give argc and argv to the gtk initialization. Widgets can use <a class="el" href="classGtk_1_1Main.html#a8719a8ac37ff6bb66048ca8967dbd782" title="Makes the innermost invocation of the main loop return when it regains control.">Gtk::Main::quit()</a> to exit from the application.</p>
<p>The internals of the widget have been disguised as signals so that the user can easily connect using the same methods used throughout the widget interface.</p>
<p>Minimal gtkmm application is something like this: </p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[]) {
<a class="code" href="classGtk_1_1Main.html" title="Main application class Every application must have one of these objects.">Gtk::Main</a> kit(argc, argv);
... create some widgets ...
kit.run();
}
</pre></div> <hr/><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" id="afbc89daf89de698660ce02426967e135"></a><!-- doxytag: member="Gtk::Main::Main" ref="afbc89daf89de698660ce02426967e135" args="(int &argc, char **&argv, Glib::OptionContext &option_context)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Gtk::Main::Main </td>
<td>(</td>
<td class="paramtype">int & </td>
<td class="paramname"> <em>argc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char **& </td>
<td class="paramname"> <em>argv</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionContext.html">Glib::OptionContext</a> & </td>
<td class="paramname"> <em>option_context</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Scans the argument vector, and strips off all parameters parsed by GTK+ or your <em>option_context</em>. </p>
<p>Add a <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionGroup.html">Glib::OptionGroup</a> to the <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionContext.html">Glib::OptionContext</a> to parse your own command-line arguments.</p>
<p>Note: The argument strings themself won't be modified, although the pointers to them might change. This makes it possible to create your own argv of string literals, which have the type 'const char[]' in standard C++. (You might need to use const_cast<>, though.)</p>
<p>This function automatically generates nicely formatted <option>--help</option> output. Note that your program will be terminated after writing out the help output.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>argc</em> </td><td>a reference to the number of command line arguments. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>argv</em> </td><td>a reference to the array of command line arguments. a string which is displayed in the first line of <option>--help</option> output, after <literal><replaceable>programname</replaceable> [OPTION...]</literal> </td></tr>
<tr><td valign="top"></td><td valign="top"><em>option_context</em> </td><td>A <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionContext.html">Glib::OptionContext</a> containing Glib::OptionGroups which described the command-line arguments taken by your program.</td></tr>
</table>
</dd>
</dl>
<dl><dt><b>Exceptions:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em><a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionError.html">Glib::OptionError</a></em> </td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ae02744d26abd4abfe106ed31f05ad2dc"></a><!-- doxytag: member="Gtk::Main::Main" ref="ae02744d26abd4abfe106ed31f05ad2dc" args="(int *argc, char ***argv, bool set_locale=true)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Gtk::Main::Main </td>
<td>(</td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>argc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *** </td>
<td class="paramname"> <em>argv</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>set_locale</em> = <code>true</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Scans the argument vector, and strips off all parameters known to GTK+. </p>
<p>Your application may then handle the remaining arguments.</p>
<p>Note: The argument strings themself won't be modified, although the pointers to them might change. This makes it possible to create your own argv of string literals, which have the type 'const char[]' in standard C++. (You might need to use const_cast<>, though.) </p>
</div>
</div>
<a class="anchor" id="a2b7340ad84fe8d66bb7489c635e8fd5e"></a><!-- doxytag: member="Gtk::Main::Main" ref="a2b7340ad84fe8d66bb7489c635e8fd5e" args="(int &argc, char **&argv, bool set_locale=true)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Gtk::Main::Main </td>
<td>(</td>
<td class="paramtype">int & </td>
<td class="paramname"> <em>argc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char **& </td>
<td class="paramname"> <em>argv</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>set_locale</em> = <code>true</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>See <a class="el" href="classGtk_1_1Main.html#ae02744d26abd4abfe106ed31f05ad2dc" title="Scans the argument vector, and strips off all parameters known to GTK+.">Main(int* argc, char*** argv, bool set_locale)</a>. </p>
</div>
</div>
<a class="anchor" id="a485eeb37361615a021ca21fb2a6f257c"></a><!-- doxytag: member="Gtk::Main::~Main" ref="a485eeb37361615a021ca21fb2a6f257c" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual Gtk::Main::~Main </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a8a5748d38300e0484a8cf7c756af8c99"></a><!-- doxytag: member="Gtk::Main::Main" ref="a8a5748d38300e0484a8cf7c756af8c99" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Gtk::Main::Main </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a16e384f8b3a02af8d3e86f59053b218e"></a><!-- doxytag: member="Gtk::Main::add_gtk_option_group" ref="a16e384f8b3a02af8d3e86f59053b218e" args="(Glib::OptionContext &option_context, bool open_default_display=true)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void Gtk::Main::add_gtk_option_group </td>
<td>(</td>
<td class="paramtype"><a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionContext.html">Glib::OptionContext</a> & </td>
<td class="paramname"> <em>option_context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>open_default_display</em> = <code>true</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Add a <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionGroup.html">Glib::OptionGroup</a>, for the commandline arguments recognized by GTK+ and GDK, to a <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionContext.html">Glib::OptionContext</a>, so that these commandline arguments will be processed in addition to the existing commandline arguments specified by the <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionContext.html">Glib::OptionContext</a>. </p>
<p>You do not need to use this method if you pass your <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1OptionContext.html">Glib::OptionContext</a> to the <a class="el" href="classGtk_1_1Main.html" title="Main application class Every application must have one of these objects.">Main</a> constructor, because it adds the gtk option group automatically.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>option_context</em> </td><td>Option Context to which the group will be added. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>open_default_display</em> </td><td>Whether to open the default display when parsing the commandline arguments. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a2a2a6cddef82f8c52026790f3f7887e0"></a><!-- doxytag: member="Gtk::Main::events_pending" ref="a2a2a6cddef82f8c52026790f3f7887e0" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static bool Gtk::Main::events_pending </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Checks if any events are pending. </p>
<p>This can be used to update the GUI and invoke timeouts etc. while doing some time intensive computation.</p>
<p>Example: Updating the GUI during a long computation. </p>
<div class="fragment"><pre class="fragment"> <span class="comment">// computation going on</span>
<span class="keywordflow">while</span>( <a class="code" href="classGtk_1_1Main.html#a2a2a6cddef82f8c52026790f3f7887e0" title="Checks if any events are pending.">Gtk::Main::events_pending</a>() )
<a class="code" href="classGtk_1_1Main.html#ab9ba7993ef8a22b6bf8796a2e4862e68" title="Runs a single iteration of the main loop.">Gtk::Main::iteration</a>();
<span class="comment">// computation continued</span>
</pre></div><dl class="return"><dt><b>Returns:</b></dt><dd>true if any events are pending, false otherwise. </dd></dl>
</div>
</div>
<a class="anchor" id="a4a8ca03d685b708e9dc38e3ddaa0875a"></a><!-- doxytag: member="Gtk::Main::events_pending_impl" ref="a4a8ca03d685b708e9dc38e3ddaa0875a" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual bool Gtk::Main::events_pending_impl </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a6f855eae235b700e2242fb68252dcea5"></a><!-- doxytag: member="Gtk::Main::init" ref="a6f855eae235b700e2242fb68252dcea5" args="(int *argc, char ***argv, bool set_locale)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Gtk::Main::init </td>
<td>(</td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>argc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *** </td>
<td class="paramname"> <em>argv</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>set_locale</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="aab3b3f72ad21e91e4c644ee5131d4058"></a><!-- doxytag: member="Gtk::Main::init_gtkmm_internals" ref="aab3b3f72ad21e91e4c644ee5131d4058" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void Gtk::Main::init_gtkmm_internals </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a94b74eb618f4b0d213c79c2ada927446"></a><!-- doxytag: member="Gtk::Main::instance" ref="a94b74eb618f4b0d213c79c2ada927446" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classGtk_1_1Main.html">Gtk::Main</a>* Gtk::Main::instance </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Access to the one global instance of <a class="el" href="classGtk_1_1Main.html" title="Main application class Every application must have one of these objects.">Gtk::Main</a>. </p>
</div>
</div>
<a class="anchor" id="ab9ba7993ef8a22b6bf8796a2e4862e68"></a><!-- doxytag: member="Gtk::Main::iteration" ref="ab9ba7993ef8a22b6bf8796a2e4862e68" args="(bool blocking=true)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static bool Gtk::Main::iteration </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>blocking</em> = <code>true</code></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Runs a single iteration of the main loop. </p>
<p>If no events are waiting to be processed GTK+ will block until the next event is noticed. If you don't want to block then pass false for <em>blocking</em> or check if any events are pending with pending() first.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>blocking</em> </td><td>Whether the caller must wait until the next event is noticed, or return immediately if there are no events. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if <a class="el" href="classGtk_1_1Main.html#a8719a8ac37ff6bb66048ca8967dbd782" title="Makes the innermost invocation of the main loop return when it regains control.">quit()</a> has been called for the innermost main loop. </dd></dl>
</div>
</div>
<a class="anchor" id="a681a82f7118d71188e64ba9379bb33e7"></a><!-- doxytag: member="Gtk::Main::iteration_impl" ref="a681a82f7118d71188e64ba9379bb33e7" args="(bool blocking)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual bool Gtk::Main::iteration_impl </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>blocking</em></td>
<td> ) </td>
<td><code> [protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a78f66b89dbe811cdce075a8b00c8987a"></a><!-- doxytag: member="Gtk::Main::level" ref="a78f66b89dbe811cdce075a8b00c8987a" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static guint Gtk::Main::level </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="aad90e366d331016ce5ff68023f214d8b"></a><!-- doxytag: member="Gtk::Main::level_impl" ref="aad90e366d331016ce5ff68023f214d8b" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual guint Gtk::Main::level_impl </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a7c3bb918c54342b71e9e56d999b4dd4e"></a><!-- doxytag: member="Gtk::Main::on_window_hide" ref="a7c3bb918c54342b71e9e56d999b4dd4e" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void Gtk::Main::on_window_hide </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a8719a8ac37ff6bb66048ca8967dbd782"></a><!-- doxytag: member="Gtk::Main::quit" ref="a8719a8ac37ff6bb66048ca8967dbd782" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void Gtk::Main::quit </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Makes the innermost invocation of the main loop return when it regains control. </p>
</div>
</div>
<a class="anchor" id="a785e09dce370a1c5260885ced9efb4a6"></a><!-- doxytag: member="Gtk::Main::quit_impl" ref="a785e09dce370a1c5260885ced9efb4a6" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void Gtk::Main::quit_impl </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="aaa2e4e282834cbe2d789fe34c447a0dd"></a><!-- doxytag: member="Gtk::Main::run" ref="aaa2e4e282834cbe2d789fe34c447a0dd" args="(Window &window)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void Gtk::Main::run </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classGtk_1_1Window.html">Window</a>& </td>
<td class="paramname"> <em>window</em></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns from the main loop when the window is closed. </p>
<p>When using this override, you should not use <a class="el" href="classGtk_1_1Main.html#a8719a8ac37ff6bb66048ca8967dbd782" title="Makes the innermost invocation of the main loop return when it regains control.">Gtk::Main::quit()</a> to close the application, but just call <a class="elRef" doxygen="libsigc++-2.0.tag:http://library.gnome.org/devel/libsigc++/unstable/" href="http://library.gnome.org/devel/libsigc++/unstable/group__hide.html#gaf28d43958b26c67e314f726540463c44">hide()</a> on your <a class="el" href="classGtk_1_1Window.html" title="Toplevel Window This represents all widgets which are physical windows controlled...">Window</a> class.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>window</em> </td><td>The window to show. This method will return when the window is hidden. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a6a8904c35952006d13cb07c1d0c16c10"></a><!-- doxytag: member="Gtk::Main::run" ref="a6a8904c35952006d13cb07c1d0c16c10" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void Gtk::Main::run </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Start the event loop. </p>
<p>This begins the event loop which handles events. No events propagate until this has been called. It may be called recursively to popup dialogs </p>
</div>
</div>
<a class="anchor" id="a2642c570bde971015f97b97cce743f80"></a><!-- doxytag: member="Gtk::Main::run_impl" ref="a2642c570bde971015f97b97cce743f80" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void Gtk::Main::run_impl </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="ab4c316c0789dfb4ab7926e062196c4e5"></a><!-- doxytag: member="Gtk::Main::signal_key_snooper" ref="ab4c316c0789dfb4ab7926e062196c4e5" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static KeySnooperSig& Gtk::Main::signal_key_snooper </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>KeySnooper signal Allows you to channel keypresses to a signal handler without registering with the widget. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>KeySnooperSig A Signal to which you can connect a sigc::slot< int, Widget *, GdkEventKey * ></dd></dl>
<p>It is the responsibility of the snooper to pass the keypress to the widget, however, care must be taken that the keypress is not passed twice. </p>
</div>
</div>
<a class="anchor" id="ac1b6ae5b79cb84158f3caf3e9382492d"></a><!-- doxytag: member="Gtk::Main::signal_quit" ref="ac1b6ae5b79cb84158f3caf3e9382492d" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static QuitSig& Gtk::Main::signal_quit </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Quit signal You can connect signal handlers to invoke actions when <a class="el" href="classGtk_1_1Main.html#a8719a8ac37ff6bb66048ca8967dbd782" title="Makes the innermost invocation of the main loop return when it regains control.">Gtk::Main::quit()</a> has been called. </p>
<p>Note that main loops can be nested by calling <a class="el" href="classGtk_1_1Main.html#a6a8904c35952006d13cb07c1d0c16c10" title="Start the event loop.">Gtk::Main::run()</a> recursively, therefore receiving this signal doesn't necessarily mean the application is about to be terminated. If you want to receive a signal only when the last main loop quits, call connect() with <code>main_level = 1</code>. </p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">bool</span> thisclass::mymethod() { <span class="keywordflow">return</span> <span class="keyword">false</span>; }
<a class="code" href="classGtk_1_1Main.html#ac1b6ae5b79cb84158f3caf3e9382492d" title="Quit signal You can connect signal handlers to invoke actions when Gtk::Main::quit()...">Gtk::Main::signal_quit</a>().connect(<a class="codeRef" doxygen="libsigc++-2.0.tag:http://library.gnome.org/devel/libsigc++/unstable/" href="http://library.gnome.org/devel/libsigc++/unstable/group__mem__fun.html#ga7d9ea809173f48bf5c76cf1989591602">sigc::mem_fun</a>(<span class="keyword">this</span>, &thisclass::mymethod));
</pre></div> <dl class="return"><dt><b>Returns:</b></dt><dd>bool - <code>false</code> means callback is removed, <code>true</code> means it'll be called again the next the main loop quits. </dd></dl>
</div>
</div>
<a class="anchor" id="aec1562f7b2a23858472aa94d23b66173"></a><!-- doxytag: member="Gtk::Main::signal_run" ref="aec1562f7b2a23858472aa94d23b66173" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static RunSig& Gtk::Main::signal_run </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Run signal. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>void </dd></dl>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a97582880bbb0ac12e957861a7ed165a3"></a><!-- doxytag: member="Gtk::Main::signal_key_snooper_" ref="a97582880bbb0ac12e957861a7ed165a3" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">KeySnooperSig <a class="el" href="classGtk_1_1Main.html#a97582880bbb0ac12e957861a7ed165a3">Gtk::Main::signal_key_snooper_</a><code> [static, protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="aee8ba380608053d85a98847eaeb564da"></a><!-- doxytag: member="Gtk::Main::signal_quit_" ref="aee8ba380608053d85a98847eaeb564da" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">QuitSig <a class="el" href="classGtk_1_1Main.html#aee8ba380608053d85a98847eaeb564da">Gtk::Main::signal_quit_</a><code> [static, protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a459e2ec96368ff1c28f351496c3200d6"></a><!-- doxytag: member="Gtk::Main::signal_run_" ref="a459e2ec96368ff1c28f351496c3200d6" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">RunSig <a class="el" href="classGtk_1_1Main.html#a459e2ec96368ff1c28f351496c3200d6">Gtk::Main::signal_run_</a><code> [static, protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>gtkmm/main.h</li>
</ul>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Tue May 4 13:21:54 2010 for gtkmm by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>
|