示例#1
0
function configure_event($widget, $event)
{
    global $pixmap;
    $pixmap = new GdkPixmap($widget->window, $widget->allocation->width, $widget->allocation->height, -1);
    gdk::draw_rectangle($pixmap, $widget->style->white_gc, true, 0, 0, $widget->allocation->width, $widget->allocation->height);
    return true;
}
示例#2
0
function configure_event($widget, $event)
{
    global $pixmap;
    $pixmap = new GdkPixmap($widget->window, $widget->allocation->width, $widget->allocation->height, -1);
    $clTransparentTest =& new GdkColor(0, 0, 0);
    gdk::gdk_color_parse('#FFAA33', $clTransparentTest);
    $style =& new GtkStyle();
    $style->base[GTK_STATE_NORMAL] = $clTransparentTest;
    gdk::draw_rectangle($pixmap, $widget->style->white_gc, true, 0, 0, $widget->allocation->width, $widget->allocation->height);
    return true;
}
示例#3
0
 function expose_event($darea, $event)
 {
     $drawable = $darea->window;
     $style = $darea->get_style();
     $white_gc = $style->white_gc;
     $grey_gc = $style->bg_gc[GTK_STATE_NORMAL];
     $black_gc = $style->black_gc;
     $max_width = $drawable->width;
     $max_height = $drawable->height;
     // 			var_dump($drawable);
     // 			var_dump($style);
     // 			var_dump($white_gc);
     // 			var_dump($black_gc);
     // 			var_dump($max_width);
     // 			var_dump($max_height);
     gdk::draw_rectangle($drawable, $white_gc, true, 0, 0, $max_width, (int) ($max_height / 2));
     gdk::draw_rectangle($drawable, $black_gc, true, 0, (int) ($max_height / 2), $max_width, (int) ($max_height / 2));
     gdk::draw_rectangle($drawable, $grey_gc, true, (int) ($max_width / 3), (int) ($max_height / 3), (int) ($max_width / 3), (int) ($max_height / 3));
 }