PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

GtkWidget::shape_combine_mask | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

GtkWidget::shape_combine_mask

void shape_combine_mask( GdkBitmap shape_mask , int offset_x, int offset_y);

This method can be used to give widgets an unnormal shape, e.g. a circle or something angulary. You can use it with all types of widgets, e.g. buttons and even windows. But see yourself:

例 59. Making an unusual shaped button

<?php
if( !extension_loaded('gtk')) {
    dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); 
}

$clickme = array(
"174 70 3 1",
" 	c None",
".	c #000000",
"+	c #FFBA01",
"                   +++++++++++++++++++++++++++++++++++++++++++++                        "
. "                                                                                      ",
"                ++++++++++++++++++++++++++++++++++++++++++++++++++++                    "
. "                                                                                      ",
"               +++++++++++++++++++++++++++++++++++++++++++++++++++++++++                "
. "                                                                                      ",
"            ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++              "
. "                                                                                      ",
"          ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++          "
. "                                                                                      ",
"        ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "+++++++++++++++++++++++++++++++++++++++++++++++                                       ",
"       +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++                             ",
"      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                       ",
"    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                  ",
"   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                 ",
"  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++               ",
"  ++++++++++++++++++++++                                 +++++++++++++++++++++++++++++++"
. "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++             ",
" +++++++++++++++++++++                                    ++++++++++++++++++++++++++++++"
. "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++           ",
" ++++++++++++++++++++                                       ++++++++++++++++++++++++++++"
. "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++         ",
" ++++++++++++++++                                             ++++++++++++++++++++++++++"
. "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++        ",
" ++++++++++++++                                                          +++++++++++++++"
. "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++      ",
" +++++++++++++                                                             +++++++      "
. "                                         ++++++++++++++++++++++++++++++++++++++++     ",
" ++++++++++++                                                                           "
. "                                                    ++++++++++++++++++++++++++++++    ",
" +++++++++++                                                                            "
. "                                                          ++++++++++++++++++++++++    ",
" +++++++++++                                                                            "
. "                                                              +++++++++++++++++++++   ",
" +++++++++++                                                                            "
. "                                                                +++++++++++++++++++   ",
" +++++++++++                                                                            "
. "                                                                  ++++++++++++++++++  ",
" +++++++++++                                                                            "
. "                                                                    ++++++++++++++++  ",
"++++++++++++                                                                            "
. "                                                                      +++++++++++++++ ",
"++++++++++++                                                                            "
. "                                                                       +++++++++++++++",
"++++++++++++                                                                            "
. "                                                                        ++++++++++++++",
"++++++++++++                               ..                                ..         "
. "                                                                         +++++++++++++",
"++++++++++++                   ........   ....      ...                     ....        "
. "                                                                         +++++++++++++",
"+++++++++++                  ...........  ....     .....                    ....        "
. "                                                                          ++++++++++++",
"+++++++++++                 ............  ....     .....                    ....        "
. "                                                                          ++++++++++++",
"+++++++++++                .............  ....      ...                     ....        "
. "                                                                           +++++++++++",
"+++++++++++               .......  .....  ....                              .....       "
. "                                                                           +++++++++++",
"+++++++++++              ......     ....  ....                              .....       "
. "                                                                           +++++++++++",
"+++++++++++             ......      ...   ....                              .....       "
. "                                                                           +++++++++++",
"+++++++++++             .....             ....                              .....      ."
. "..                  ..                                                     +++++++++++",
"+++++++++++            .....              ....      ..         .......      .....     .."
. "...                ....  ......  ......           ......                   +++++++++++",
"+++++++++++            .....              ....     ....       ..........    .....    ..."
. "...                .... ................        ..........                 +++++++++++",
"+++++++++++           .....               ....     ....      ............   .....   ...."
. "...                .....................       ............                +++++++++++",
"+++++++++++           ....                ....     ....     .............   .....  ....."
. "..                 ......................     .............                +++++++++++",
"+++++++++++           ....                ....     ....     .....    ...    ..... ......"
. ".                  ........ ....... .....    ......   .....                +++++++++++",
"+++++++++++          .....                ....     ....    .....            ............"
. "                   .......  .....    ....    .....    .....               ++++++++++++",
"+++++++++++          ....                 ....     ....    .....            ........... "
. "                   ......   ....     ....    ....   .......               ++++++++++++",
"+++++++++++          ....                 ....     ....   .....             ..........  "
. "                   .....    ....     ....   ....  ........               +++++++++++++",
"+++++++++++          ....                 ....     ....   .....             ........... "
. "                   ....     ....     ....   ............                ++++++++++++++",
"+++++++++++          ....           ..    ....     ....   ....              ............"
. "                   ....     ....     .....  ..........                  ++++++++++++++",
"++++++++++++         .....        .....   ....     ....   ....              ...... ....."
. "                   ....     .....    .....  ........                    +++++++++++++ ",
"++++++++++++          .....      ......   ....     ....   ....              ....    ...."
. ".                  ....     .....    .....  ......                      +++++++++++++ ",
"+++++++++++++         ......   ........   ....     ....   .....       ..    ....    ...."
. "..                 ....     .....    .....  .....        ...           +++++++++++++  ",
"++++++++++++++         ...............    ....     ....    ......   .....   ....     ..."
. "...                ....      ....     ....   ......    .....           +++++++++++++  ",
"+++++++++++++++         ............      ....     ....    ..............   ....      .."
. "...                ....      ....     ....   ...............           ++++++++++++   ",
" ++++++++++++++++        ..........       ....     ....     .............   ....       ."
. "....               ....      ....     ....    .............            ++++++++++++   ",
" +++++++++++++++++         .....          ....     ....      ..........     ....       ."
. "...                ....      ....     ....     ...........            +++++++++++++   ",
" +++++++++++++++++++                       ..       ..         ......        ..         "
. "...                 ..       ...       ...       .......             +++++++++++++    ",
"  +++++++++++++++++++                                                                   "
. "                                                                    ++++++++++++++    ",
"   ++++++++++++++++++++++                                                               "
. "                                                                 +++++++++++++++++    ",
"    +++++++++++++++++++++++++++++                                                       "
. "                                                               +++++++++++++++++++    ",
"     +++++++++++++++++++++++++++++++++                                                  "
. "                                                           ++++++++++++++++++++++     ",
"      ++++++++++++++++++++++++++++++++++++++++++++                                      "
. "                                                 ++++++++++++++++++++++++++++++++     ",
"       ++++++++++++++++++++++++++++++++++++++++++++++++++++++                           "
. "                                           +++++++++++++++++++++++++++++++++++++      ",
"        ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++       ",
"          ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++        ",
"           +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++         ",
"             +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++          ",
"              ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++           ",
"                ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++            ",
"                    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                ",
"                             +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                 ",
"                                 +++++++++++++++++++++++++++++++++++++++++++++++++++++++"
. "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                      ",
"                                              ++++++++++++++++++++++++++++++++++++++++++"
. "++++++++++++++++++++++++++++++++++++++++++++++++++++++                                ",
"                                                        ++++++++++++++++++++++++++++++++"
. "++++++++++++++++++++++++++++++++++++++++++++++++                                      "
);

$window = &new GtkWindow();
$window->set_default_size( 200, 100);

$window->connect_object('destroy', array('gtk', 'main_quit'));
$window->realize();

list($pixmap, $mask) = gdk::pixmap_create_from_xpm_d( $window->window, null, $clickme);

$btn = &new GtkButton( '');
$btn->shape_combine_mask($mask, 5, 5);

$style = $btn->style;
$style->bg[GTK_STATE_NORMAL]	= new GdkColor( 'orange');
$style->bg[GTK_STATE_PRELIGHT] = new GdkColor('#FF0000');
$style->bg[GTK_STATE_ACTIVE] = new GdkColor('#00FF00');
$btn->set_style( $style);

$window->add( $btn);

$window->show_all();
gtk::main();
?>
忘却曲線を使ってこの知識を確実に記憶に残す

フォーラムで「GtkWidget::shape_combine_mask」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | GtkWidget::shape_combine_mask」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: