root.c File Reference

#include <gtk/gtk.h>
#include "ergtk-keyb.h"
#include "logging.h"
Include dependency graph for root.c:

Go to the source code of this file.

Functions

static void button_clicked_callback (GtkButton *button, GtkWindow *parent)
static void button_redraw_clicked_callback (GtkButton *button, GtkWindow *parent)
static gboolean focus_in_callback (void)
static gboolean focus_out_callback (void)
int main (int argc, char **argv)

Variables

static GtkWidget * g_dialog = NULL

Function Documentation

static void button_clicked_callback ( GtkButton *  button,
GtkWindow *  parent 
) [static]

Copyright (C) 2009 iRex Technologies B.V. All rights reserved.

Definition at line 107 of file root.c.

References ergtk_keyb_new(), focus_in_callback(), focus_out_callback(), and g_dialog.

Referenced by main().

00108 {
00109     GtkWidget* dialog;
00110     GtkWidget* dialog_hbox;
00111     GtkWidget* dialog_keyboard;
00112     GtkWidget* dialog_entry;
00113     GtkWidget* dialog_search_button;
00114 
00115     dialog = gtk_dialog_new_with_buttons(
00116             "Destroy?",
00117             parent,
00118             GTK_DIALOG_DESTROY_WITH_PARENT, 
00119             "_Destroy", GTK_RESPONSE_ACCEPT,
00120             "_Abort",   GTK_RESPONSE_REJECT,
00121             NULL);
00122 
00123     g_dialog = GTK_WIDGET(dialog);
00124 
00125     gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_REJECT);
00126 
00127     dialog_hbox = gtk_hbox_new(TRUE,3);
00128     dialog_entry = gtk_entry_new();
00129 
00130     // only supported from gtk+ >= 2.16 
00131     //dialog_entry = GTK_WIDGET( gtk_object_new(GTK_TYPE_ENTRY, 
00132     //            "im-module", "Xander!", 
00133     //            NULL));
00134    
00135 
00136     /* connect own callbacks to focus events */
00137     /* use the TRUE return value to prevent further calling
00138      * of focus-in and focus-out callbacks that are registered
00139      * in the input method context
00140      */
00141     g_signal_connect(G_OBJECT(dialog_entry), "focus-in-event", G_CALLBACK(focus_in_callback), NULL);
00142     g_signal_connect(G_OBJECT(dialog_entry), "focus-out-event", G_CALLBACK(focus_out_callback), NULL);
00143     dialog_search_button = gtk_button_new_with_label("Search");
00144     
00145     gtk_container_add(GTK_CONTAINER(dialog_hbox), dialog_entry);
00146     gtk_widget_show(dialog_entry);
00147     gtk_container_add(GTK_CONTAINER(dialog_hbox), dialog_search_button);
00148     gtk_widget_show(dialog_search_button);
00149 
00150 
00151     gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), dialog_hbox);
00152     gtk_widget_show(dialog_hbox);
00153 
00154     dialog_keyboard = ergtk_keyb_new();
00155 
00156     gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), dialog_keyboard);
00157     gtk_widget_show(dialog_keyboard);
00158     
00159     gtk_widget_show(dialog);
00160     //gtk_widget_show_all(dialog);
00161 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void button_redraw_clicked_callback ( GtkButton *  button,
GtkWindow *  parent 
) [static]

Definition at line 164 of file root.c.

References g_dialog.

Referenced by main().

00165 {
00166     if ( NULL  != g_dialog )
00167     {
00168         gtk_widget_queue_draw(g_dialog);
00169     }
00170     else 
00171     {
00172         return;
00173     }
00174 }

Here is the caller graph for this function:

static gboolean focus_in_callback ( void   )  [static]

Definition at line 180 of file root.c.

References DBG, DBG_ENTRY, and DBG_EXIT.

Referenced by button_clicked_callback().

00181 {
00182     DBG_ENTRY;
00183     DBG("==========================>>>>>>>>>> FOCUS IN CALLBACK <<<<<<<<<<<<===================== \n");
00184     DBG_EXIT;
00185     return TRUE; // prevents docked keyboard from showing
00186     return FALSE; // makes docked keyboard show also 
00187 }

Here is the caller graph for this function:

static gboolean focus_out_callback ( void   )  [static]

Definition at line 189 of file root.c.

References DBG, DBG_ENTRY, and DBG_EXIT.

Referenced by button_clicked_callback().

00190 {
00191     DBG_ENTRY;
00192     DBG("==========================>>>>>>>>>> FOCUS OUT CALLBACK <<<<<<<<<<<<===================== \n");
00193     DBG_EXIT;
00194     return TRUE; // prevents docked keyboard from showing
00195     return FALSE; // makes docked keyboard show also 
00196 }

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 64 of file root.c.

References button_clicked_callback(), and button_redraw_clicked_callback().

00065 {
00066 
00067     GtkWidget* window = NULL;
00068     GtkWidget* button = NULL;
00069     GtkWidget* button_redraw = NULL;
00070     GtkWidget* hbox = NULL ; 
00071 
00072     gtk_init(&argc, &argv);
00073 
00074     window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
00075     gtk_window_set_title(GTK_WINDOW(window), "KEYBOARD FIND DIALOG TEST");
00076     gtk_container_set_border_width(GTK_CONTAINER(window), 10);
00077 
00078     button = gtk_button_new_with_mnemonic("_Create Dialog");
00079     button_redraw = gtk_button_new_with_mnemonic("_Redraw Dialog");
00080 
00081 
00082     g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(button_clicked_callback), (gpointer) window);
00083     g_signal_connect(G_OBJECT(button_redraw), "clicked", G_CALLBACK(button_redraw_clicked_callback), (gpointer) window);
00084 
00085 
00086     hbox = gtk_hbox_new(3, FALSE );
00087 
00088 
00089     g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL );
00090 
00091     gtk_container_add(GTK_CONTAINER(hbox), button);
00092     gtk_container_add(GTK_CONTAINER(hbox), button_redraw);
00093     gtk_container_add(GTK_CONTAINER(window), hbox);
00094 
00095     gtk_widget_show_all(window);
00096 
00097     gtk_main();
00098 
00099 
00100     return 0;
00101 
00102 }

Here is the call graph for this function:


Variable Documentation

GtkWidget* g_dialog = NULL [static]

Definition at line 53 of file root.c.

Referenced by button_clicked_callback(), and button_redraw_clicked_callback().

Generated by  doxygen 1.6.2-20100208