Re: Re: [php-gtk-cvs] cvs: php-gtk /test bug_gtkfilechooserbutton_actionselectfolder.phpw
| From: | Steph Fox | Date: | Tue, 04 Apr 2006 17:50:02 +0000 |
| Subject: | Re: Re: [php-gtk-cvs] cvs: php-gtk /test bug_gtkfilechooserbutton_actionselectfolder.phpw | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-2710@lists.php.net to get a copy of this message | ||
weird, I can't find anything in bugzilla either that smells right.
I managed to find my icon warning though :) http://bugzilla.gnome.org/show_bug.cgi?id=149931
----- Original Message ----- From: "Scott Mattocks" <scott@crisscott.com>
To: <php-gtk-dev@lists.php.net>
Sent: Tuesday, April 04, 2006 7:34 PM
Subject: Re: [PHP-GTK-DEV] Re: [php-gtk-cvs] cvs: php-gtk /test bug_gtkfilechooserbutton_actionselectfolder.phpw
No problem with C either. Scott Mattocks wrote:--------------------------------------------------------------------------------Andrei Zmievski wrote:-- Scott Mattocks Author of the soon to be published: Pro PHP-GTK http://www.crisscott.com __________ NOD32 1.1380 (20060125) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.comI don't think this is a PHP-GTK problem necessarily. Scott, can you try and convert your script to PyGtk and see if it does the same thing there?The attached script (a rip off of the PyGtk Hello World example) runs without errors for me. It is slightly different however because PyGtk doesn't allow you to pass the action on construction. I will try to recreate the errors with straight Gtk+ but my c skills are about as good as my Python skills. Scott ------------------------------------------------------------------------ #!/usr/bin/env python # example helloworld.py import pygtk pygtk.require('2.0') import gtk class HelloWorld:# This is a callback function. The data arguments are ignored # in this example. More on callbacks below. def hello(self, widget, data=None): print "Hello World"def delete_event(self, widget, event, data=None): # If you return FALSE in the "delete_event" signal handler, # GTK will emit the "destroy" signal. Returning TRUE means # you don't want the window to be destroyed. # This is useful for popping up 'are you sure you want to quit?' # type dialogs. print "delete event occurred"# Change FALSE to TRUE and the main window will not be destroyed # with a "delete_event". return Falsedef destroy(self, widget, data=None): print "destroy signal occurred" gtk.main_quit()def __init__(self): # create a new window self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)# When the window is given the "delete_event" signal (this is given # by the window manager, usually by the "close" option, or on the # titlebar), we ask it to call the delete_event () function # as defined above. The data passed to the callback # function is NULL and is ignored in the callback function. self.window.connect("delete_event", self.delete_event)# Here we connect the "destroy" event to a signal handler. # This event occurs when we call gtk_widget_destroy() on the window, # or if we return FALSE in the "delete_event" callback. self.window.connect("destroy", self.destroy)# Sets the border width of the window. self.window.set_border_width(10)# Creates a new button with the label "Hello World". self.button = gtk.FileChooserButton("Hello World")#self.button.set_action(gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER)# When the button receives the "clicked" signal, it will call the # function hello() passing it None as its argument. The hello() # function is defined above. #self.button.connect("clicked", self.hello, None)# This will cause the window to be destroyed by calling # gtk_widget_destroy(window) when "clicked". Again, the destroy # signal could come from here, or the window manager. #self.button.connect_object("clicked", gtk.Widget.destroy, self.window)# This packs the button into the window (a GTK container). self.window.add(self.button)# The final step is to display this newly created widget. self.button.show()# and the window self.window.show()def main(self): # All PyGTK applications must have a gtk.main(). Control ends here # and waits for an event to occur (like a key press or mouse event). gtk.main()# If the program is run directly or passed as an argument to the python # interpreter then create a HelloWorld instance and show it if __name__ == "__main__":hello = HelloWorld() hello.main()
#include <gtk/gtk.h> static gboolean delete_event( GtkWidget *widget,--------------------------------------------------------------------------------GdkEvent *event, gpointer data ){ return FALSE; } static void destroy( GtkWidget *widget,gpointer data ){ gtk_main_quit (); } int main( int argc,char *argv[] ){ GtkWidget *window; GtkWidget *button; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (G_OBJECT (window), "delete_event",G_CALLBACK (delete_event), NULL);g_signal_connect (G_OBJECT (window), "destroy",G_CALLBACK (destroy), NULL);gtk_container_set_border_width (GTK_CONTAINER (window), 10); button = gtk_file_chooser_button_new ("Hello World", GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_show (button); gtk_widget_show (window); gtk_main (); return 0; } __________ NOD32 1.1380 (20060125) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com
-- PHP-GTK Development Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __________ NOD32 1.1380 (20060125) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com