-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add first steps of relations editor widget.
- Loading branch information
Marcus Lundblad
committed
Nov 23, 2014
1 parent
f6b144e
commit 6f67d47
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ | ||
/* | ||
* relations-editor.vala | ||
* Copyright (C) 2014 Marcus Lundblad <[email protected]> | ||
* | ||
* tabler is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* tabler is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
public class Tabler.RelationsEditor : Gtk.Grid { | ||
|
||
public Arrangement arrangement { get; set; } | ||
|
||
public RelationsEditor () { | ||
} | ||
|
||
// update the grid widget widget with a new arrangement | ||
public void update_arrangement () { | ||
stdout.printf ("new arrangement set in relations editor\n"); | ||
|
||
arrangement.guest_added.connect (on_guest_added); | ||
arrangement.guest_removed.connect (on_guest_removed); | ||
|
||
int i = 1; | ||
foreach (var guest in arrangement.guests.values) { | ||
var horizontal_label = new Gtk.Label (guest.name); | ||
var vertical_label = new Gtk.Label (guest.name); | ||
|
||
horizontal_label.xalign = 0; | ||
|
||
vertical_label.angle = 90; | ||
vertical_label.yalign = 1.0f; | ||
|
||
attach (horizontal_label, 0, i, 1, 1); | ||
attach (vertical_label, i, 0, 1, 1); | ||
horizontal_label.visible = true; | ||
vertical_label.visible = true; | ||
i++; | ||
} | ||
} | ||
|
||
private void on_guest_added (Guest guest) { | ||
stderr.printf ("Guest added %s\n", guest.name); | ||
} | ||
|
||
private void on_guest_removed (Guest guest) { | ||
stderr.printf ("Guest removed\n"); | ||
} | ||
|
||
} | ||
|