// the following code is taken from PEAR::Image_Color
    $degree = 40;
    $color[] = hexdec(substr($arData[1], 0, 2));
    $color[] = hexdec(substr($arData[1], 2, 2));
    $color[] = hexdec(substr($arData[1], 4, 2));
    for ($x = 0; $x < 3; $x++) {
        if ($color[$x] + $degree < 256) {
            if ($color1[$x] + $degree > -1) {
                $color[$x] += $degree;
            } else {
                $color[$x] = 0;
            }
        } else {
            $color[$x] = 255;
        }
    }
    $arData[1] = sprintf('%02X%02X%02X', $color[0], $color[1], $color[2]);
    $arXPMs['high'][$nA] = implode(' #', $arData);
}
$arPxTestH = gdk::pixmap_create_from_xpm_d($window->window, null, $arXPMs['high']);
$pxmTestHigh =& new GtkPixmap($arPxTestH[0], $arPxTestH[1]);
$btnTest->connect('enter', 'changePixmap', 'enter', $pxmTestHigh);
$btnTest->connect('leave', 'changePixmap', 'leave', $pxmTest);
$alBtn =& new GtkAlignment(0.5, 0.5, 0, 0);
$alBtn->add($btnTest);
list($pxWindow, $maskWindow) = gdk::pixmap_create_from_xpm_d($window->window, null, $arXPMs['inbox']);
$gdkwindow = $window->window;
$gdkwindow->set_icon($gdkwindow, $pxWindow, $maskWindow);
$window->add($alBtn);
$window->show_all();
gtk::main();
Exemple #2
0
 function add1000_clist($button, $clist)
 {
     $gtk_mini_xpm = array("15 20 17 1", "       c None", ".      c #14121F", "+      c #278828", "@      c #9B3334", "#      c #284C72", "\$      c #24692A", "%      c #69282E", "&      c #37C539", "*      c #1D2F4D", "=      c #6D7076", "-      c #7D8482", ";      c #E24A49", ">      c #515357", ",      c #9B9C9B", "'      c #2FA232", ")      c #3CE23D", "!      c #3B6CCB", "               ", "      ***>     ", "    >.*!!!*    ", "   ***....#*=  ", "  *!*.!!!**!!# ", " .!!#*!#*!!!!# ", " @%#!.##.*!!\$& ", " @;%*!*.#!#')) ", " @;;@%!!*\$&)'' ", " @%.%@%\$'&)\$+' ", " @;...@\$'*'*)+ ", " @;%..@\$+*.')\$ ", " @;%%;;\$+..\$)# ", " @;%%;@\$\$\$'.\$# ", " %;@@;;\$\$+))&* ", "  %;;;@+\$&)&*  ", "   %;;@'))+>   ", "    %;@'&#     ", "     >%\$\$      ", "      >=       ");
     list($pixmap, $mask) = gdk::pixmap_create_from_xpm_d($clist->window, $clist->style->white, $gtk_mini_xpm);
     for ($i = 0; $i < 12; $i++) {
         $texts[$i] = "Column {$i}";
     }
     $texts[1] = 'Right';
     $texts[2] = 'Center';
     $texts[3] = null;
     $clist->freeze();
     for ($i = 0; $i < 1000; $i++) {
         $texts[0] = "CListRow " . rand() % 10000;
         $row = $clist->append($texts);
         $clist->set_pixtext($row, 3, "gtk+", 5, $pixmap, $mask);
     }
     $clist->thaw();
 }