Codebase list sugar-toolkit-gtk3 / 83697d2
Save As - add an optional Gtk.Entry to Alert An Alert may have a Gtk.Entry, which is placed between the title and the buttons. It is for when text is to be input during the alert. James Cameron 6 years ago
1 changed file(s) with 17 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
109109 self._buttons_box = Gtk.HButtonBox()
110110 self._buttons_box.set_layout(Gtk.ButtonBoxStyle.END)
111111 self._buttons_box.set_spacing(style.DEFAULT_SPACING)
112 self._hbox.pack_start(self._buttons_box, True, True, 0)
112 self._hbox.pack_end(self._buttons_box, True, True, 0)
113113
114114 GObject.GObject.__init__(self, **kwargs)
115115
156156 elif pspec.name == 'msg':
157157 return self._msg
158158
159 def add_entry(self):
160 """
161 Add an entry, after the title and before the buttons.
162
163 Returns:
164 Gtk.Entry: the entry added to the alert
165 """
166 entry = Gtk.Entry()
167 self._hbox.pack_start(entry, True, True, 0)
168 entry.show()
169
170 self._hbox.set_child_packing(self._buttons_box, False, False, 0,
171 Gtk.PackType.END)
172
173 return entry
174
159175 def add_button(self, response_id, label, icon=None, position=-1):
160176 """
161177 Add a button to the alert