English 中文(简体)
Can you set the DefaultResponse for a Gtk Dialog in Glade?
原标题:

In my code, I have lines like this:

Builder builder = new Builder();
builder.AddFromFile(gladefile);
FileChooserDialog dialog =
    (FileChooserDialog) builder.GetObject("dialog");

dialog.DefaultResponse = ResponseType.Ok;

Is there a way to set the default response in the glade file, rather than doing it manually?

最佳回答

Yes. When you create a GtkFileChooserDialog in Glade, you add the buttons to the dialog s button box. For example, "OK" and "Cancel". To make the "OK" button default, select the "OK" button, go to the "Common" properties, and turn on "Can default" and "Has default".

问题回答

暂无回答




相关问题
Pointers in Lisp?

I ve started learning Lisp recently and wanted to write a program which uses gtk interface. I ve installed lambda-gtk bindings (on CMUCL). I want to have putpixel/getpixel ability on a pixbuf. But I ...

In Gtk, how do I make a Button with just a stock icon?

I want to create a button with the stock "Remove" icon on it, but without the text "Remove". If I use Button button = new Button(Stock.Remove);, I get the opposite: just the text, and no icon. I will ...

Using GtkMenu in Gtk+-2.14.0

I am building an application which has GtkMenu widget. I am using Glade RAD tool to develop UI and while creating project in Glade I have specified version of GTK as 2.16 which supports GtkMenu and ...

Can you set the FileFilters for a Gtk Dialog in Glade?

In my code, I have lines like this: Builder builder = new Builder(); builder.AddFromFile(gladefile); FileChooserDialog dialog = (FileChooserDialog) builder.GetObject("dialog"); FileFilter[] ...

热门标签