Re: Couple of Gnome programming problems



Fir the first question, try calling gtk_widget_queue_resize on the drawing
area.  For the second, maybe it would be better to create a new subclass
of GtkWidget.  That way you would have more control over the redraw
behaviour of the widget.  You could probably do this by modifying the
GtkDrawingArea widget code from GTK.

For the final one, do you mean that you want the close button to not do
anything, or do you want the button to not destroy the widget.  The
GnomeDialog implementation allows you to make the window manager close
button either destroy or hide the widget.  You could also use motif WM
hints to tell the WM not to display the close button.  This can be
accomplished with the following code:
  gtk_widget_realize(dialog);
  gdk_window_set_functions(dialog->window,
	GDK_FUNC_RESIZE|GDK_FUNC_MOVE|GDK_FUNC_MINIMIZE|GDK_FUNC_MAXIMIZE);
  gtk_widget_show(dialog);

This will disable the close function on window managers that respect the
mwm hints (most do these days).  But don't rely on this behaviour.

James Henstridge.

--
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/


On 14 Apr 1999, Dave Cole wrote:

> I am busily writing a new game for Gnome, and have a few problems with
> gaps in my knowledge.
> 
> Here is the current list of "Things I am too stupid to fix" from the
> homepage.
> 
> *	The turn indicator at the right of the status bar is not
> 	growing/shrinking. When the server tells the client how many
> 	players are in the game, I try to resize the GtkDrawingArea
> 	indicator in the GnomeAppBar. Unfortunately nothing happens
> 	(If I manually resize the main window, everything is magically
> 	fixed up).
> 
> *	The map is rendered on a GtkDrawingArea. When you resize the
> 	window, the map is redrawn at the maximum scale that will fit
> 	in the available area. Unfortunately, the entire drawing area
> 	seems to be getting cleared with the background colour before
> 	I get my "expose" event. This causes a really annoying flicker
> 	(window manager is set to do opaque resize).
> 
> *	The dialog that the user interacts with to discard resources
> 	is constructed using gnome_dialog_new(). Unfortunately, the
> 	GnomeDialog widget class sets up a default "delete_event"
> 	handler which automatically closes the dialog. I want to be
> 	able to prevent the dailog being killed via the window
> 	mananger.
> 
> OK, the second one is not a Gnome problem :-)
> 
> If you want to see what the game is, point your browser at:
> 
> 	http://www.dccs.com.au/~dave/gnocatan/
> 
> - Dave
> 
> 
> -- 
>         FAQ: Frequently-Asked Questions at http://www.gnome.org/gnomefaq
>          To unsubscribe: mail gnome-list-request@gnome.org with 
>                        "unsubscribe" as the Subject.
> 



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