Example #1
0
    return true;
}
function draw_brush($widget, $x, $y)
{
    global $pixmap;
    gdk::draw_arc($pixmap, $widget->style->black_gc, true, $x - 4, $y - 4, 8, 8, 0, 64 * 360);
    $widget->draw(new GdkRectangle($x - 4, $y - 4, 8, 8));
}
$window =& new GtkWindow();
$window->set_name('Test Input');
$window->set_position(GTK_WIN_POS_CENTER);
$window->connect_object('destroy', array('gtk', 'main_quit'));
$vbox =& new GtkVBox();
$window->add($vbox);
$vbox->show();
$drawing_area =& new GtkDrawingArea();
$drawing_area->size(300, 300);
$vbox->pack_start($drawing_area);
$drawing_area->show();
$drawing_area->connect('expose_event', 'expose_event');
$drawing_area->connect('configure_event', 'configure_event');
$drawing_area->connect('motion_notify_event', 'motion_notify_event');
$drawing_area->connect('button_press_event', 'button_press_event');
$drawing_area->set_events(GDK_EXPOSURE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK);
$button =& new GtkButton('Quit');
$vbox->pack_start($button, false, false);
$button->connect_object('clicked', array($window, 'destroy'));
$button->show();
$window->show();
gtk::main();
Example #2
0
 /**
  * Start the main gtk loop.
  *
  * main() first sets the default state of the showPassed
  * check box. Next all widgets that are part of the GUI
  * are shown. Finally the main gtk loop is started.
  *
  * @access public
  * @param  boolean $showPassed
  * @return void
  */
 function main($showPassed = true)
 {
     $this->showPassed->set_active($showPassed);
     $this->gui->show_all();
     gtk::main();
 }
Example #3
0
function XMLparseFinElement($parser, $name)
{
    global $Xlasthandler, $Xw, $Xpath, $Xoptions, $Xn, $Yn, $Xparent, $Xcontainer, $Yc;
    if ($name == 'SCRIPT') {
        $Xstring .= $Xlasthandler . '</script>';
    }
    if ($name == 'CODE') {
        if ($Xtemp[CODE]) {
        }
    }
    if ($name == 'HBOX') {
        $Yc--;
    }
    if ($name == 'VBOX') {
        $Yc--;
    }
    if ($name == 'FRAME') {
        $Yc--;
    }
    if ($name == 'TBOX') {
    }
    if ($name == 'TR') {
    }
    if ($name == 'TD') {
    }
    if ($name == 'LAYER') {
    }
    if ($name == 'NOTEBOOK') {
    }
    if ($name == 'PAGE') {
    }
    if ($name == 'LABEL') {
    }
    if ($name == 'ENTRY') {
    }
    if ($name == 'TEXT') {
    }
    if ($name == 'HIDDEN') {
    }
    if ($name == 'SPIN') {
    }
    if ($name == 'BUTTON') {
        $Xn[BUTTON]++;
        if (!$Xoptions[NAME]) {
            $Xoptions[NAME] = 'button' . $Xn[BUTTON];
        }
        $Xparent[$Yn] =& new GtkButton($Xlasthandler);
        $Yw[$Xoptions[NAME]] = $Yn;
        $Xoptions[ONCLICK] = str_replace("'", "\\'", $Xoptions[ONCLICK]);
        if ($Xoptions[ACTIVE] == '0') {
            $Xparent[$Yn]->set_sensitive(0);
        }
        $Xcontainer[$Yc]->pack_start($Xparent[$Yn], 0, 0);
        //$Xoptions[NAME],$Xlasthandler,$Xoptions[IMAGE],$Xoptions[ONCLICK],$Xoptions[VALUE],$Xoptions[ACTIVE], $Xoptions[WIDTH]).XmindBetweenBox($Xtemp,$Xbox);
    }
    if ($name == 'TOGGLE') {
    }
    if ($name == 'CHECKBOX') {
    }
    if ($name == 'RADIO') {
    }
    if ($name == 'PROGRESSBAR') {
    }
    if ($name == 'IMAGE') {
    }
    if ($name == 'DRAWINGAREA') {
    }
    if ($name == 'CLIST') {
    }
    if ($name == 'OPTION') {
    }
    if ($name == 'XMIND') {
        $Xparent[0]->show_all();
        gtk::main();
    }
}
Example #4
0
 function display()
 {
     $this->window->show_all();
     gtk::main();
 }
Example #5
0
 /**
  * Checks to see if the file has been saved before destroying the
  * main window.
  * 
  * The user should save their file before the application closes.
  * If they have not, they will be prompted to save or close any
  * way.
  *
  * This method will also kill the main gtk loop if told to. If 
  * this class is imbedded in another class, you probably don't
  * want to do that. Pass false to the constructor to prevent 
  * this from happening.
  *
  * @param  boolean $killMainLoop
  * @return void
  * @access public
  */
 function checkBeforeQuit($killMainLoop)
 {
     // Check to see if the file was saved.
     if (!$this->saved) {
         // Prompt the user with a GtkDialog window.
         $dialog =& new GtkDialog();
         $vBox = $dialog->vbox;
         $vBox->pack_start(new GtkLabel('Your package file has not been saved.' . ' Would you like to save it now?'));
         $dialog->show_all();
         gtk::main();
     }
     // Kill the main loop if requested.
     if ($killMainLoop) {
         return gtk::main_quit();
     } else {
         return true;
     }
 }