Verifying input data before gtk_dialog_run returns

2007-03-21 Thread Jaap Haitsma
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


Re: Verifying input data before gtk_dialog_run returns

2007-03-21 Thread Jaap Haitsma
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


[ANNOUNCE] Browser search plugin for search GNOME developer documentation

2006-11-27 Thread jaap haitsma
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=gnomemode=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?

2005-11-21 Thread Jaap Haitsma

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)

2005-11-17 Thread Jaap Haitsma
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


How to get a GtkSizeGroup?

2005-11-16 Thread Jaap Haitsma

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

Re: How to get a GtkSizeGroup? (with attachment)

2005-11-16 Thread Jaap Haitsma

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