Re: How to determine usable Desktop Bounds

2007-03-21 Thread Yeti
On Thu, Mar 22, 2007 at 10:48:48AM +0530, Gaurav Jain wrote: > I need to determine the actual desktop bounds usable by a GTK > application on a Linux Desktop. The screen size (the one returned by > gdk_screen_width() and gdk_screen_height()) also includes window > manager bars such as the task bar

How to determine usable Desktop Bounds

2007-03-21 Thread Gaurav Jain
Hi, I need to determine the actual desktop bounds usable by a GTK application on a Linux Desktop. The screen size (the one returned by gdk_screen_width() and gdk_screen_height()) also includes window manager bars such as the task bar, the panels on top and bottom of the screen, etc. and I don't w

Re: Verifying input data before gtk_dialog_run returns

2007-03-21 Thread Allin Cottrell
On Wed, 21 Mar 2007, Allin Cottrell wrote: > If you follow this model, it's a nice courtesy to offer the > user a way out: a Cancel button in the original dialog, > which allows them to say, "The heck with this 'invalid input', > I'm out of here." So of course the callback for the Cancel button i

Re: Verifying input data before gtk_dialog_run returns

2007-03-21 Thread Allin Cottrell
On Wed, 21 Mar 2007, 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 err

Re: Verifying input data before gtk_dialog_run returns

2007-03-21 Thread Yeti
How is this all connected to the topic of the thread? On Thu, Mar 22, 2007 at 01:27:29AM +0100, G Hasse wrote: > What you should do is > > > void enter_callback(GtkWidget *widget, GtkWidget *entry) > { > > gchar *entry_text = NULL; > entry_text = gtk_entry_get_text(GTK_ENTRY(entry)); >

Re: Verifying input data before gtk_dialog_run returns

2007-03-21 Thread G Hasse
Hello, What you should do is void enter_callback(GtkWidget *widget, GtkWidget *entry) { gchar *entry_text = NULL; entry_text = gtk_entry_get_text(GTK_ENTRY(entry)); // Check to se what the entry contains... printf("the entry: %s\n", entry_text); } main() { entry = gtk_

Re: Verifying input data before gtk_dialog_run returns

2007-03-21 Thread Yeti
On Wed, Mar 21, 2007 at 11:56:36PM +0100, Jaap Haitsma wrote: > 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

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 say

Re: SIGINT with gtk_main

2007-03-21 Thread Michiel Jan Laurens de Hoon
[EMAIL PROTECTED] wrote: > static void signal_handler(int sig) > { > switch (sig) { > case SIGINT: > puts("SIGINT signal catched"); > break; > case SIGTERM: > puts("SIGTERM signal catched"); >

Re: Verifying input data before gtk_dialog_run returns

2007-03-21 Thread Yeti
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 c

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 l

Re: FW: Dialog closing prematurely with response code of 0

2007-03-21 Thread Yeti
On Wed, Mar 21, 2007 at 04:42:39PM -0400, Kevin Lambert wrote: > Does anybody have any ideas about this? It looks like the response from > gtk_dialog_response is being captured by dialogs that don't match the > GtkDialog pointer that was passed in. Post some code. Evidently it works for everyone

Re: SIGINT with gtk_main

2007-03-21 Thread zz
On Wednesday 21 March 2007 18:50:38 Michiel Jan Laurens de Hoon wrote: > For my application, I need to run gtk_main but I want to quit gtk_main > when either input is available on stdin or the user presses Ctrl-C. The > former is easy (using g_io_add_watch), but I am not sure what the best > app

FW: Dialog closing prematurely with response code of 0

2007-03-21 Thread Kevin Lambert
Does anybody have any ideas about this? It looks like the response from gtk_dialog_response is being captured by dialogs that don't match the GtkDialog pointer that was passed in. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Lambert Sent: Thursda

SIGINT with gtk_main

2007-03-21 Thread Michiel Jan Laurens de Hoon
For my application, I need to run gtk_main but I want to quit gtk_main when either input is available on stdin or the user presses Ctrl-C. The former is easy (using g_io_add_watch), but I am not sure what the best approach is to handle Ctrl-C. Right now I am using g_timeout_add to check every 1