ToastFreeware
/
gregoa
/
zavai.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5bd72f1
)
Allow to select grammar using extra button
author
Enrico Zini
<enrico@enricozini.org>
Thu, 13 Aug 2009 17:18:22 +0000
(18:18 +0100)
committer
Enrico Zini
<enrico@enricozini.org>
Thu, 13 Aug 2009 17:18:22 +0000
(18:18 +0100)
src/app_polygen.vala
patch
|
blob
|
history
diff --git
a/src/app_polygen.vala
b/src/app_polygen.vala
index 0fe16f8d5766b89713a8ac2529b7780f0186336f..05a85c6bfb9432b58189df30e6151fbed3f315cb 100644
(file)
--- a/
src/app_polygen.vala
+++ b/
src/app_polygen.vala
@@
-46,6
+46,17
@@
protected class PolygenPage : Object
list.row_activated += on_row_activated;
}
list.row_activated += on_row_activated;
}
+ public void select()
+ {
+ // Get currently selected/focused
+ Gtk.TreePath path;
+ Gtk.TreeViewColumn col;
+ list.get_cursor(out path, out col);
+
+ // Activate it
+ list.row_activated(path, col);
+ }
+
private void on_row_activated(Gtk.TreeView tv, Gtk.TreePath path, Gtk.TreeViewColumn column)
{
Gtk.TreeIter iter;
private void on_row_activated(Gtk.TreeView tv, Gtk.TreePath path, Gtk.TreeViewColumn column)
{
Gtk.TreeIter iter;
@@
-196,7
+207,23
@@
public class Polygen : Applet
notebook.append_page(result, new Gtk.Label("Result"));
pack_start(notebook, true, true, 0);
notebook.append_page(result, new Gtk.Label("Result"));
pack_start(notebook, true, true, 0);
+
+ Gtk.Button select = new Gtk.Button.with_label("Select");
+ button_box.pack_start(select, true, true, 0);
+ select.clicked += on_click;
}
}
+
+ private void on_click(Gtk.Button b)
+ {
+ stderr.printf("ZA\n");
+ if (notebook.page >= pages.size)
+ result.update(); // If we are in the result page, just update
+ else
+ {
+ PolygenPage page = pages[notebook.page];
+ page.select();
+ }
+ }
}
Polygen polygen;
}
Polygen polygen;