// CALLBACKS FOR FIRST PART public void AddAccessory(object layerButton, EventArgs args) { try { ToolButton btn = layerButton as ToolButton; Image img = new Image("./accessories/" + btn.Label + ".png"); _model.AddLayer(img.Pixbuf, btn.Label); _listView.Selected = _model.NumLayers - 1; } catch (Exception e) { MessageDialog md = new MessageDialog(this, DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Close, "Scale size out of bounds!"); int result = md.Run(); md.Destroy(); } }
void OnStarClick(object sender, EventArgs args) { _cm.AddLayer(new Gdk.Pixbuf("/Users/eliaanagnostou/Documents/cs71/03-photobooth-eanagno1-zbatool1/accessories/star.png"), "star"); }
//requires: the accessory image and the image name //effects: triggers AddLayer of the CompositeModel void OnAccessoryCallback(Gdk.Pixbuf accessoryImage, string accessoryName) { _model.AddLayer(accessoryImage, accessoryName); }