aboutsummaryrefslogtreecommitdiffstats
path: root/src/gui/EdgeView.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-04-02 01:52:53 +0000
committerDavid Robillard <d@drobilla.net>2007-04-02 01:52:53 +0000
commitdb6f6e87dc4ff620f399597913f14a3b4eda277f (patch)
tree4258f8cc7f2a841fd41ce9dac222919f0ee98eeb /src/gui/EdgeView.cpp
parent69ad86f21555d28f5065923eea06ccc3cc4f4ce5 (diff)
downloadmachina-db6f6e87dc4ff620f399597913f14a3b4eda277f.tar.gz
machina-db6f6e87dc4ff620f399597913f14a3b4eda277f.tar.bz2
machina-db6f6e87dc4ff620f399597913f14a3b4eda277f.zip
Edge label toggling.
Made state properties dialog actually work. Other things... git-svn-id: http://svn.drobilla.net/lad/machina@390 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/EdgeView.cpp')
-rw-r--r--src/gui/EdgeView.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/gui/EdgeView.cpp b/src/gui/EdgeView.cpp
index fccf8d5..d8e11a9 100644
--- a/src/gui/EdgeView.cpp
+++ b/src/gui/EdgeView.cpp
@@ -42,11 +42,26 @@ EdgeView::length_hint() const
void
+EdgeView::show_label(bool show)
+{
+ if (show) {
+ char label[4];
+ snprintf(label, 4, "%3f", _edge->probability());
+ set_label(label);
+ } else {
+ set_label("");
+ }
+}
+
+
+void
EdgeView::update_label()
{
- char label[4];
- snprintf(label, 4, "%3f", _edge->probability());
- set_label(label);
+ if (_label) {
+ char label[4];
+ snprintf(label, 4, "%3f", _edge->probability());
+ set_label(label);
+ }
}