Re: How do I use the fullscreen in a gtkmm app?
- From: Carlos Pereira <jose carlos pereira ist utl pt>
- To: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: Re: How do I use the fullscreen in a gtkmm app?
- Date: Wed, 11 Jun 2008 22:29:35 +0100
Garth's KidStuff wrote:
Hi All,
I notice that quite a few apps (firefox, gimp, terminal, etc. -- but not
gedit, huh?) have the option to toggle fullscreen mode in their view menu
using the F11 key. How would I implement this in my Gtkmm app?
Connect the key_press_event to your top window, ot to a drawing area,
and then prepare a callback along these lines (sorry, C code):
#include <gdk/gdkkeysyms.h>
void function_handle_key_press (GtkWidget *widget,
GdkEventKey *event, void *data)
{
GtkWidget *window = (GtkWindow *) data; /* this is just a simple example */
static int fullscreen = FALSE;
switch (event->keyval)
{
case GDK_F11:
if (fullscreen == FALSE)
{
gdk_window_raise (window->window);
hide decorations;
gtk_window_fullscreen (GTK_WINDOW (window));
fullscreen = TRUE;
}
else
{
show decorations;
gtk_window_unfullscreen (GTK_WINDOW (window));
fullscreen = FALSE;
}
break;
}
Thanks in advance
-Garth
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]