[Glade-users] freezing an entire window + search algorithms for clist

Daniel Macedo wrote:
Does anybody know how to "freeze " a window? I have a main window,
which opens dialogs. If I click the window's button more than once, it
will open more than one dialog. Is it possible to freeze the main
window while the other window is open, so it doesn't receive any

This feature of graphical user interface toolkits like GTK+ is very
useful, as it lets the user decide how many dialogs are active at once,
however there are rare situations in which you don't want it to work
like that, and you want to force the user down one response path.

The usual term is "modal dialog".  When you create the dialog window,
call the function gtk_window_set_modal() for which the prototype in
gtkwindow.h says it requires a GtkWindow and a boolean flag.  This will
affect all other windows for the application, not just the main window.

In my opinion, it is far better to mark the menu button widget as
insensitive while the dialog is on screen, so that another dialog of the
same class cannot be started.  This also allows the user to have more
than one type of dialog window open.  The way I do this is to call
gtk_widget_set_sensitive() against the widget that caused the callback,
thus making it "grey out".  Then, when the dialog window closes (or is
closed by the window manager), I call the function again to enable the
menu button widget.

See http://quozl.netrek.org/gfocustimer/ for example code.  This is a
main window with a preferences window.  If the preferences window is on
screen, the preferences menu button in the main window is insensitive. 
In src/preferences.c you can find the calls that disable and enable the
button on the main window.

I cant find a way here to find multiple ocurrences of a search. Is
there any other function that does find more than one match, or I will
have to do this myself?

I don't know of one off-hand.  Go find the function you mentioned in the
source code and make a copy of it for your own use.  I question the
situation though; why would the same data pointer occur in the list more
than once?

Whats the prototype for GdkColor?

gdktypes.h:typedef struct _GdkColor           GdkColor;

/* The color type.
 *   A color consists of red, green and blue values in the
 *    range 0-65535 and a pixel value. The pixel value is highly
 *    dependent on the depth and colormap which this color will
 *    be used to draw into. Therefore, sharing colors between
 *    colormaps is a bad idea.
struct _GdkColor
  gulong  pixel;
  gushort red;
  gushort green;
  gushort blue;

James Cameron                                 (james cameron compaq com)

http://quozl.linux.org.au/         (or)         http://quozl.netrek.org/

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]