Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

With Glade in a dialog window, how do you add response for buttons

Tags:

gtk

glade

gtk3

How do you link the buttons of a dialog window (GtkDialog for example) with a response Gtk::ResponseType value with Glade?.

I know how to do it programmatically but I can not find out how to do it with Glade.

In short I have to create the ui file with a GtkDialog and with two buttons in the actions area with the ids button_ok and button_cancel for example. And after that I edit the file and add those lines :

<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface>
  <requires lib="gtk+" version="3.20"/>
  <object class="GtkDialog" id="dialog1">
  <!-- the objects added by Glade -->

  <!-- What I need to add -->
  <action-widgets>
      <action-widget response="cancel">button_cancel</action-widget>
      <action-widget response="ok" default="true">button_ok</action-widget>
  </action-widgets>
  <!-- What I need to add -->

  </object>
</interface>

Is there a way to do this through the interface of Glade ?

like image 577
cedlemo Avatar asked May 02 '16 14:05

cedlemo


1 Answers

Response ID is the second option under Button Attributes.

like image 198
Blake Avatar answered Sep 20 '22 05:09

Blake