Re: Verifying input data before gtk_dialog_run returns
On 3/21/07, David Nečas (Yeti) <[EMAIL PROTECTED]> wrote: > On Wed, Mar 21, 2007 at 10:51:42PM +0100, Jaap Haitsma wrote: > > Is there a recommended way to check if the data in a dialog is valid > > when the user presses the OK button? If the data is not OK I want to > > present a modal dialog saying there is an error. If the user closes > > that dialog the user can correct the error and press OK again. > > You can read the values, otherwise you would not be able to > use the dialog at all. > > The dialog does not close itself on OK, you always > explicitly destroy it. > > So you can read the values and *not* destroy the dialog if > you don't like them (and display another dialog, etc.), > right? See also the recusrive dialogs in my last post > (http://mail.gnome.org/archives/gtk-app-devel-list/2007-March/msg00154.html). > So the recommended way to do it is just do the following (in pseudo code) do { response = gtk_dialog_run () } while (response == OK && !validated ) I thought of using this but it did not really seem like an elegant way to do it. I was thinking that there might be some signal handler which could do the checking and that gtk_dialog_run would only return if OK was pressed and the data was valid Jaap ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Verifying input data before gtk_dialog_run returns
Hi, Is there a recommended way to check if the data in a dialog is valid when the user presses the OK button? If the data is not OK I want to present a modal dialog saying there is an error. If the user closes that dialog the user can correct the error and press OK again. The concrete case I'm looking at is in a file save dialog where I want to check if a user entered a valid file extension when he/she presses the save button. Thanks Jaap ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[ANNOUNCE] Browser search plugin for search GNOME developer documentation
Hi, Often I'm searching on the developer.gnome.org site for API description of a certain widget I want to use. So I made a search plugin for it, which I thought people on this list might like. You can install it from here if you like. http://www.searchplugins.net/pluginlist.aspx?q=gnome&mode=title Click on the "I" of I|S|R to install it. Happy searching Jaap ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: [SOLVED] How to get a GtkSizeGroup?
Jaap Haitsma wrote: Hi, I have a number of comboboxes that I want to have exactly the same size, and also I want them to align vertically. I can't use a table because in the dialog I want to use them there will be some text in between. Somebody on this list pointed me to use GtkSizeGroup. However using that I still can't get it right. I attached a very simple project, where I try and do it. I'm hoping that somebody can take a took at it and tell me what I do wrong. It works if you put the labels instead of the comboboxes in the GtkSizeGroup Jaap ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to get a GtkSizeGroup? (with attachment)
Some how my attachments don't come through. Here's a link to the tarball placed on my website http://jaap.haitsma.org/gtksizegroup.tar.gz Jaap ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to get a GtkSizeGroup? (with attachment)
Jaap Haitsma wrote: Hi, I have a number of comboboxes that I want to have exactly the same size, and also I want them to align vertically. I can't use a table because in the dialog I want to use them there will be some text in between. Somebody on this list pointed me to use GtkSizeGroup. However using that I still can't get it right. I attached a very simple project, where I try and do it. I'm hoping that somebody can take a took at it and tell me what I do wrong. Thanks Jaap PROGRAM = gtksizegroup PREFIX = /usr CFLAGS = -g `pkg-config --cflags libgnomeui-2.0` \ `pkg-config --cflags libglade-2.0` \ -ansi -Wall \ -DPREFIX=\""$(PREFIX)\"" \ -DSYSCONFDIR=\""$(PREFIX)/etc"\" \ -DDATADIR=\""$(PREFIX)/share"\" \ -DLIBDIR=\""$(PREFIX)/lib"\" LIBS = `pkg-config --libs libgnomeui-2.0` \ `pkg-config --libs libglade-2.0` $(PROGRAM): $(PROGRAM).c gcc -o $(PROGRAM) $(PROGRAM).c $(CFLAGS) $(LIBS) clean: rm -f $(PROGRAM) ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
How to get a GtkSizeGroup?
Hi, I have a number of comboboxes that I want to have exactly the same size, and also I want them to align vertically. I can't use a table because in the dialog I want to use them there will be some text in between. Somebody on this list pointed me to use GtkSizeGroup. However using that I still can't get it right. I attached a very simple project, where I try and do it. I'm hoping that somebody can take a took at it and tell me what I do wrong. Thanks Jaap ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Aligning widgets in a set of vboxes and hboxes
Hi, I'd like to align a number of widgets which are in vboxes and hboxes. The dialog is very similar to the File Management Preferences dialog of nautilus [1]. The only problem is that if I run my application my comboboxes do not have the same size. They do in nautilus. If you load the nautilus glade file in glade they also don't seem to have the same size but if you run nautilus they have. I've been trying for hours now to find out what the difference is, but I can't seem to find it. Does anybody know which property I need to set, to get my comboboxes all of the same size?? (I can't use a table because as in the nautilus dialog I have different "sections" in the dialog) Thanks Jaap [1] http://jaap.haitsma.org/shot.png ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Hiding a window when clicking on the desktop
Alem Dain wrote: 2005/6/25, Jaap Haitsma <[EMAIL PROTECTED]>: Hi, ... I have most of it implemented already. The only thing which I haven't figured out yet is the second part of point 2. That is hiding the sticky notes when you click on the desktop. Does anybody have an idea how I can adapt the sticky notes applet so that this can be done? Perhaps you could grab the pointer and have a GdkRegion representing the on-screen territory of your app. Then, at every click, check to see if the pointer was inside this region. If so, ignore. If not, then release the grab and hide the windows (don't forget to release the grab). Thanks for the suggestion. I've looked into this a bit but it seems to me that gdk_pointer_grab seems to grab all mouse click events and the other windows do not receive the mouse clicks then. Furthermore I only want to know if the click was on the desktop. So basically sticky_notes should receives mouse clicks of nautilus that is running on the desktop. A long time ago in windows I've used program tool called window inspector (name of the program could also be different), which you can tell which events it should log from which window. Is something like that possible in GTK? Then I just have to monitor the nautilus desktop window and the button_press event. Jaap ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Hiding a window when clicking on the desktop
Hi, I'm currently hacking a bit on the sticky notes applet. I'm basically trying to implement what I put in the bug report [1]. I.e. 1. If you click on the panel icon for sticky notes all sticky notes come to the top. 2. If you click outside of one of the stickynotes all sticky notes become invisible. Also when you click on the desktop. 3. Double click on the panel icon creates a new sticky I have most of it implemented already. The only thing which I haven't figured out yet is the second part of point 2. That is hiding the sticky notes when you click on the desktop. Does anybody have an idea how I can adapt the sticky notes applet so that this can be done? Thanks Jaap [1] http://bugzilla.gnome.org/show_bug.cgi?id=308701 ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list