eb05362005-11-05Henrik Grubbström (Grubba) /* -*- C -*- */
1a05542005-07-28Martin Nilsson require gtk26; class GTK2.FileChooserButton; inherit GTK2.Hbox;
bf24222011-09-12Lance Dillon inherit GTK2.FileChooser;
1a05542005-07-28Martin Nilsson  //! Properties: //! GTK2.FileChooserDialog dialog
f284492006-08-03Lance Dillon require gtk210; //! int focus-on-click endrequire;
1a05542005-07-28Martin Nilsson //! string title //! int width-chars
3d76632005-11-03Lance Dillon void create(string|mapping(string:mixed) title_or_props, ?int action)
1a05542005-07-28Martin Nilsson //! Create a new file-selecting button widget. //! action is one of CONST(GTK_FILE_CHOOSER_ACTION_)
3d76632005-11-03Lance Dillon {
ba9e802006-02-27Martin Stjernholm  pgtk2_verify_not_inited(); pgtk2_verify_setup();
3d76632005-11-03Lance Dillon  {
017b572011-10-28Henrik Grubbström (Grubba)  if (TYPEOF(Pike_sp[-args]) == PIKE_T_STRING) {
535ddd2005-12-18Marcus Comstedt  struct pike_string *title;
cac4202005-12-17Marcus Comstedt  INT_TYPE action;
3d76632005-11-03Lance Dillon  GtkWidget *gf;
535ddd2005-12-18Marcus Comstedt  get_all_args("create",args,"%t%i",&title,&action); ref_push_string(title); f_string_to_utf8(1);
eac9aa2005-12-18Martin Nilsson  gf=gtk_file_chooser_button_new(CGSTR0(Pike_sp[-1].u.string),action);
535ddd2005-12-18Marcus Comstedt  pop_stack();
3d76632005-11-03Lance Dillon  THIS->obj=G_OBJECT(gf); } else { INIT_WITH_PROPS(GTK_TYPE_FILE_CHOOSER_BUTTON); }
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_title(); //! Retrieves the title of the browse dialog. void set_title(string title); //! Modifies the title of the browse dialog. int get_width_chars(); //! Retrieves the width in characters of the button widget's //! entry and/or label. void set_width_chars(int n_chars); //! Sets the width (in characters) that the button will use.
f284492006-08-03Lance Dillon endrequire; require gtk210; int get_focus_on_click(); //! Returns whether the button grabs focus when it is clicked.
1a05542005-07-28Martin Nilsson 
f284492006-08-03Lance Dillon void set_focus_on_click(int focus); //! Sets whether the button will grab focus when it is clicked with the mouse. //! Making mouse clicks not grab focus is useful in places like toolbars where //! you don't want the keyboard focus removed from the main area of the //! application.
1a05542005-07-28Martin Nilsson endrequire;