eb05362005-11-05Henrik Grubbström (Grubba) /* -*- C -*- */
1a05542005-07-28Martin Nilsson class GTK2.FontSelectionDialog; inherit GTK2.Dialog; //! The GtkFontSelectionDialog widget is a dialog box for selecting a font. //! <p> //! To set the font which is initially selected, use set_font_name(). //! </p><p> //! To get the selected font use get_font_name(). //! </p><p> //! To change the text which is shown in the preview area, use //! set_preview_text(). //! </p> //! TIMG: GTK2.FontSelectionDialog("Select a font") member GTK2.Button ok_button; //! The ok button member GTK2.Button apply_button; //! The apply button member GTK2.Button cancel_button; //! The cancel button
3d76632005-11-03Lance Dillon void create(string title)
1a05542005-07-28Martin Nilsson //! Create a new font selection dialog with the specified window title
3d76632005-11-03Lance Dillon {
ba9e802006-02-27Martin Stjernholm  pgtk2_verify_not_inited(); pgtk2_verify_setup();
3d76632005-11-03Lance Dillon  {
535ddd2005-12-18Marcus Comstedt  struct pike_string *title;
3d76632005-11-03Lance Dillon 
017b572011-10-28Henrik Grubbström (Grubba)  if (TYPEOF(Pike_sp[-args]) == PIKE_T_STRING) {
3d76632005-11-03Lance Dillon  GtkWidget *gf;
96f5f42018-08-05Martin Nilsson  get_all_args(NULL,args,"%t",&title);
535ddd2005-12-18Marcus Comstedt  ref_push_string(title); f_string_to_utf8(1);
eac9aa2005-12-18Martin Nilsson  gf=gtk_font_selection_dialog_new(CGSTR0(Pike_sp[-1].u.string));
535ddd2005-12-18Marcus Comstedt  pop_stack();
3d76632005-11-03Lance Dillon  THIS->obj=G_OBJECT(gf); } else { INIT_WITH_PROPS(GTK_TYPE_FONT_SELECTION_DIALOG); }
ba9e802006-02-27Martin Stjernholm  pgtk2_pop_n_elems(args);
3d76632005-11-03Lance Dillon  }
ba9e802006-02-27Martin Stjernholm  pgtk2__init_this_object();
3d76632005-11-03Lance Dillon }
1a05542005-07-28Martin Nilsson  string get_font_name(); //! Gets the currently-selected font name. int set_font_name(string font); //! Sets the currently-selected font. string get_preview_text(); //! Gets the text displayed in the preview area. void set_preview_text(string text); //! Sets the text displayed in the preview area.