# vte.c File Reference

`#include "gnoclVTE.h"`

Go to the source code of this file.

## Functions
static int | vteFunc (ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
static int | configure (Tcl_Interp *interp, GtkWidget *term, GnoclOption options[])
| Configure the vte widget based upon parameters passed to the calling function.
int | gnoclVTECmd (ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
## Variables
static GnoclOption | vteOptions []

## Function Documentation

static int configure | ( | Tcl_Interp * | interp,
|  | GtkWidget * | term,
|  | GnoclOption | options[] |
| ) |  |  | `[static]`

Configure the vte widget based upon parameters passed to the calling function.

Author:
  WJG

Date:
  12-03-2008

Bug:
  none

Definition at line 97 of file vte.c.

Referenced by gnoclVTECmd().

    00101 {
    00102         g_print ( "vte/configure\n" );
    00103         return TCL_OK;
    00104 }

int gnoclVTECmd | ( | ClientData | data,
|  | Tcl_Interp * | interp,
|  | int | objc,
|  | Tcl_Obj *const | objv[] |
| ) |  |  |

gnoclVTECmd

Definition at line 110 of file vte.c.

References configure(), vteFunc(), and vteOptions.

    00115 {
    00116
    00117         g_print ( "gnoclVTECmd\n" );
    00118
    00119         int               ret;
    00120         GtkWidget *term;
    00121
    00122         if ( gnoclParseOptions ( interp, objc, objv, vteOptions ) != TCL_OK )
    00123         {
    00124                 gnoclClearOptions ( vteOptions );
    00125                 return TCL_ERROR;
    00126         }
    00127
    00128
    00129         GtkWidget *terminal = vte_terminal_new ();
    00130
    00131         GtkWidget *scrollbar = gtk_vscrollbar_new ( vte_terminal_get_adjustment
    00132                                                    ( VTE_TERMINAL ( terminal ) ) );
    00133         GtkWidget *hbox = gtk_hbox_new ( FALSE, 0 );
    00134
    00135         vte_terminal_fork_command ( VTE_TERMINAL ( terminal ), "/bin/bash",
    00136                                                                 NULL, NULL, g_get_home_dir (), FALSE, FALSE, FALSE );
    00137         vte_terminal_set_font_from_string ( VTE_TERMINAL ( terminal ), "Monospace 9" );
    00138         vte_terminal_set_scroll_on_output ( VTE_TERMINAL ( terminal ), FALSE );
    00139         vte_terminal_set_scroll_on_keystroke ( VTE_TERMINAL ( terminal ), TRUE );
    00140         vte_terminal_set_mouse_autohide ( VTE_TERMINAL ( terminal ), TRUE );
    00141
    00142         gtk_box_pack_start ( GTK_BOX ( hbox ), terminal, TRUE, TRUE, 0 );
    00143
    00144         gtk_box_pack_start ( GTK_BOX ( hbox ), scrollbar, FALSE, FALSE, 0 );
    00145
    00146         /* set options */
    00147
    00148
    00149         gtk_widget_show ( GTK_WIDGET ( terminal ) );
    00150
    00151         ret = gnoclSetOptions ( interp, vteOptions, G_OBJECT ( terminal ), -1 );
    00152
    00153         if ( ret == TCL_OK )
    00154         {
    00155                 ret = configure ( interp, terminal, vteOptions );
    00156         }
    00157
    00158         gnoclClearOptions ( vteOptions );
    00159
    00160         if ( ret != TCL_OK )
    00161         {
    00162                 gtk_widget_destroy ( GTK_WIDGET ( terminal ) );
    00163                 return TCL_ERROR;
    00164         }
    00165
    00166
    00167         char *command = "mc\n";
    00168
    00169         /* -background */
    00170         GdkColor color;
    00171         gchar text[] = "red";
    00172         gdk_color_parse ( &text, &color );
    00173         vte_terminal_set_color_background ( VTE_TERMINAL ( terminal ), &color );
    00174
    00175         /* -foreground */
    00176         vte_terminal_set_color_foreground ( VTE_TERMINAL ( terminal ), &color );
    00177
    00178         /* -tint */
    00179         vte_terminal_set_background_tint_color ( VTE_TERMINAL ( terminal ), &color );
    00180
    00181         /* -bold */
    00182         vte_terminal_set_color_bold ( VTE_TERMINAL ( terminal ), &color );
    00183
    00184         /* -saturation */
    00185         vte_terminal_set_background_saturation ( VTE_TERMINAL ( terminal ), 0.5 );
    00186
    00187         /* -transparent */
    00188         vte_terminal_set_background_transparent ( VTE_TERMINAL ( terminal ), 1 );
    00189
    00190         /* -backgroundImage */
    00191         vte_terminal_set_background_image_file ( VTE_TERMINAL ( terminal ), "./EU_flag.jpg" );
    00192
    00193         /* -scrollBackground */
    00194         vte_terminal_set_scroll_background ( VTE_TERMINAL ( terminal ), 1 );
    00195
    00196         /* -cursor
    00197          * typedef enum {
    00198             VTE_CURSOR_SHAPE_BLOCK,
    00199             VTE_CURSOR_SHAPE_IBEAM,
    00200             VTE_CURSOR_SHAPE_UNDERLINE
    00201                 } VteTerminalCursorShape;
    00202          * */
    00203         /* not available */
    00204         /*
    00205          vte_terminal_set_cursor_shape (VTE_TERMINAL (terminal),1);
    00206         */
    00207
    00208         /* -cursorBlink default = 0*/
    00209         vte_terminal_set_cursor_blinks ( VTE_TERMINAL ( terminal ), 1 );
    00210
    00211         /* -mouseHide default = 1*/
    00212         vte_terminal_set_mouse_autohide ( VTE_TERMINAL ( terminal ), 0 );
    00213
    00214         /* -font */
    00215         // vte_terminal_set_font_from_string (VTE_TERMINAL (terminal), text);
    00216
    00217         /* -hearBell default = 0 */
    00218         vte_terminal_set_audible_bell ( VTE_TERMINAL ( terminal ), 1 );
    00219
    00220         /* -seeBell default = 0 */
    00221         vte_terminal_set_visible_bell ( VTE_TERMINAL ( terminal ), 1 );
    00222
    00223         /* -allowBold */
    00224         vte_terminal_set_allow_bold ( VTE_TERMINAL ( terminal ), 1 );
    00225
    00226         /* id feed ??string?? */
    00227         vte_terminal_feed_child ( VTE_TERMINAL ( terminal ), command, strlen ( command ) );
    00228
    00229         return gnoclRegisterWidget ( interp, GTK_WIDGET ( hbox ) , vteFunc );
    00230
    00231         //return TCL_OK;
    00232
    00233 }

static int vteFunc | ( | ClientData | data,
|  | Tcl_Interp * | interp,
|  | int | objc,
|  | Tcl_Obj *const | objv[] |
| ) |  |  | `[static]`

vteFunc

Definition at line 82 of file vte.c.

Referenced by gnoclVTECmd().

    00087 {
    00088         return TCL_OK;
    00089 }

## Variable Documentation

GnoclOption vteOptions[]`[static]`

Widget options

Definition at line 35 of file vte.c.

Referenced by gnoclVTECmd().