/* Create a font widget for browsing. */
GtkWidget *
gui_font_prefs_show(void)
{
	/* Create the font selection widget. */
	font_browse_w = (GtkWidget *) gtk_font_selection_new();
	gtk_widget_show(font_browse_w);

	return font_browse_w;
}
示例#2
0
/* Create a font widget for browsing. */
GtkWidget *
gui_font_prefs_show(void)
{
	/* Create the font selection widget. */
#if GTK_CHECK_VERSION(3,2,0)
	font_browse_w = gtk_font_chooser_widget_new();
#else
	font_browse_w = (GtkWidget *) gtk_font_selection_new();
#endif /* GTK_CHECK_VERSION(3,2,0) */
	gtk_widget_show(font_browse_w);

	return font_browse_w;
}
示例#3
0
int main(int argc, char *argv[])
{    
    gtk_init(&argc, &argv);
    
    GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    g_signal_connect(window, "destroy", G_CALLBACK(destroy), NULL);

    GtkWidget *fontselection = gtk_font_selection_new();
    gtk_container_add(GTK_CONTAINER(window), fontselection);
         
    gtk_widget_show_all(window);
    
    gtk_main();
    
    return 0;
}
示例#4
0
文件: conf.c 项目: erikg/bmud
void
conffont ()
{
    if (blah)
    {
	if (this_panel_cb)
	    this_panel_cb ();
	gtk_widget_destroy (blah);
    }
    blah = gtk_font_selection_new ();
    gtk_font_selection_set_font_name (GTK_FONT_SELECTION (blah), fntname);
    gtk_widget_show (blah);
    gtk_box_pack_start (GTK_BOX (hbox), blah, 0, 0, 2);
    this_panel_cb = update_font;
    return;
}
示例#5
0
/**
\brief
\author
\date
**/
int gnoclFontSelectionCmd ( ClientData data, Tcl_Interp *interp,
                            int objc, Tcl_Obj * const objv[] )
{


    int ret = TCL_OK;
    GtkWidget *widget;


    if ( gnoclParseOptions ( interp, objc, objv, fontSelectOptions ) != TCL_OK )
    {
        gnoclClearOptions ( fontSelectOptions );
        return TCL_ERROR;
    }


    widget = gtk_font_selection_new() ;

    gtk_widget_show ( GTK_WIDGET ( widget ) );



    ret = gnoclSetOptions ( interp, fontSelectOptions, G_OBJECT ( widget ), -1 );

    if ( ret == TCL_OK )
    {
        ret = configure ( interp, G_OBJECT ( widget ), fontSelectOptions );
    }


    gnoclClearOptions ( fontSelectOptions );

    /* STEP 3)  -show the widget */

    if ( ret != TCL_OK )
    {
        gtk_widget_destroy ( GTK_WIDGET ( widget ) );
        return TCL_ERROR;
    }


    /* STEP 4)  -everything has worked, register the widget with the Tcl interpretor. */
    return gnoclRegisterWidget ( interp, GTK_WIDGET ( widget ), fontSelFunc );


    return ret;
}
示例#6
0
文件: font.c 项目: BunsenLabs/yad
GtkWidget *
font_create_widget (GtkWidget * dlg)
{
  GtkWidget *w;

  w = font = gtk_font_selection_new ();
  gtk_widget_set_name (w, "yad-font-widget");

  if (options.font_data.preview)
    gtk_font_selection_set_preview_text (GTK_FONT_SELECTION (w), options.font_data.preview);

  /* font must be set after widget inserted in toplevel */
  if (options.common_data.font)
    g_signal_connect_after (G_OBJECT (w), "realize", G_CALLBACK (realize_cb), NULL);

  return w;
}
示例#7
0
int
main (int argc, char *argv[])
{
  GtkWidget *window;
  GtkWidget *hbox;
  GtkWidget *fontsel;
  
  gtk_init (NULL, NULL);
    
  fontsel = gtk_font_selection_new ();

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_set_size_request (window, 600, 600);
  hbox = gtk_hbox_new (FALSE, 6);
  gtk_container_add (GTK_CONTAINER (window), hbox);

#ifndef GTK_DISABLE_DEPRECATED
  g_object_ref (gtk_font_selection_get_size_list (GTK_FONT_SELECTION (fontsel)));
  g_object_ref (gtk_font_selection_get_family_list (GTK_FONT_SELECTION (fontsel)));
  g_object_ref (gtk_font_selection_get_face_list (GTK_FONT_SELECTION (fontsel)));

  gtk_container_add (GTK_CONTAINER (hbox), gtk_font_selection_get_size_list (GTK_FONT_SELECTION (fontsel)));
  gtk_container_add (GTK_CONTAINER (hbox), gtk_font_selection_get_family_list (GTK_FONT_SELECTION (fontsel)));
  gtk_container_add (GTK_CONTAINER (hbox), gtk_font_selection_get_face_list (GTK_FONT_SELECTION (fontsel)));
#endif 

  gtk_container_add (GTK_CONTAINER (hbox), fontsel);

  gtk_widget_show_all (window);

  g_signal_connect (G_OBJECT (window), "delete-event",          G_CALLBACK(gtk_main_quit), NULL);
  g_signal_connect (G_OBJECT (fontsel), "notify::font-name",    G_CALLBACK(notify_font_name_cb), NULL);
  g_signal_connect (G_OBJECT (fontsel), "notify::preview-text", G_CALLBACK(notify_preview_text_cb), NULL);

  gtk_font_selection_set_font_name (GTK_FONT_SELECTION (fontsel), "Bitstream Vera Sans 45");
  gtk_font_selection_set_preview_text (GTK_FONT_SELECTION (fontsel), "[user@host ~]$ ");

  gtk_main ();

  gtk_widget_destroy (window);

  return 0;
}
示例#8
0
int main(int argc, char **argv) {
  gtk_init(&argc, &argv);

  GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  GtkWidget* fontsel = gtk_font_selection_new();

  gtk_signal_connect(GTK_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(gtk_main_quit), NULL);

  gtk_window_set_default_size(GTK_WINDOW(window), 400, 300);
  gtk_container_border_width(GTK_CONTAINER(window), 20);

  gtk_container_add(GTK_CONTAINER(window), fontsel);

  gtk_widget_show(fontsel);
  gtk_widget_show(window);

  gtk_main();

  return 0;
}
示例#9
0
static int _fontsel(void)
{
	GtkWidget * window;
	GtkWidget * fontsel;

	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_container_set_border_width(GTK_CONTAINER(window), 4);
	gtk_window_set_title(GTK_WINDOW(window), _("Font browser"));
	g_signal_connect_swapped(G_OBJECT(window), "delete-event", G_CALLBACK(
				_fontsel_on_closex), window);
#if GTK_CHECK_VERSION(3, 2, 0)
	fontsel = gtk_font_chooser_widget_new();
#else
	fontsel = gtk_font_selection_new();
#endif
	gtk_container_add(GTK_CONTAINER(window), fontsel);
	gtk_widget_show_all(window);
	gtk_main();
	return 0;
}
示例#10
0
/****  Font selection constructor ****/
int
clip_GTK_FONTSELECTIONNEW(ClipMachine * ClipMachineMemory)
{
   ClipVar  *cv = _clip_spar(ClipMachineMemory, 1);

   GtkWidget *wid = NULL;

   C_widget *cwid;

   CHECKOPT(1, MAP_type_of_ClipVarType);

   wid = gtk_font_selection_new();
   if (!wid)
      goto err;
   cwid = _register_widget(ClipMachineMemory, wid, cv);

   _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);
   return 0;
 err:
   return 1;
}
示例#11
0
文件: print.c 项目: laubstein/pw3270
 static GObject * create_custom_widget(GtkPrintOperation *prt, gpointer user_data)
 {
 	GtkWidget *font_dialog =  gtk_font_selection_new();
    g_signal_connect(font_dialog, "realize", G_CALLBACK(load_font), prt);
 	return G_OBJECT(font_dialog);
 }
示例#12
0
/*
 * Creates a new GtkWidget of class GtkFontSelection, performing any specialized
 * initialization needed for the widget to work correctly in this environment.
 * If a dialog box is used to initialize the widget, return NULL from this
 * function, and call data->callback with your new widget when it is done.
 * If the widget needs a special destroy handler, add a signal here.
 */
GtkWidget*
gb_font_selection_new (GbWidgetNewData *data)
{
  return gtk_font_selection_new ();
}