Skip to content

Instantly share code, notes, and snippets.

View cwensley's full-sized avatar

Curtis Wensley cwensley

View GitHub Profile
$ codesign -vvv ./TestMonoMacSigning.app/
./TestMonoMacSigning.app/: a sealed resource is missing or invalid
In architecture: i386
resource added: /Users/curtis/Projects/test/TestMonoMacSigning/TestMonoMacSigning/bin/x86/AppStore/TestMonoMacSigning.app/Contents/embedded.provisionprofile
resource added: /Users/curtis/Projects/test/TestMonoMacSigning/TestMonoMacSigning/bin/x86/AppStore/TestMonoMacSigning.app/Contents/PkgInfo
@cwensley
cwensley / gist:4043483
Created November 9, 2012 03:12
Force long polling in jabbr
transport = $.cookie('jabbr.transport'),
options = {};
if (transport) {
options['transport'] = transport;
}
+ else
+ options['transport'] = 'longPolling';
connection.hub.logging = logging;
class MyImageLabel : Drawable {
Image image;
Font font = Fonts.Sans (10);
public string Text { get; set; }
public override void OnPaint (PaintEventArgs e)
{
e.Graphics.DrawImage (image, 0, 0);
e.Graphics.DrawText (font, 0, 0, Text)
class MyImageLabel : Drawable {
Font font = Fonts.Sans (10);
public Image Image { get; set; }
public string Text { get; set; }
public override void OnPaint (PaintEventArgs e)
{
if (Image != null)
@cwensley
cwensley / CustomImageButton.cs
Last active December 18, 2015 22:08
Custom image button
using System;
using Eto.Drawing;
using Eto.Forms;
namespace Samples
{
public class MyButton : Drawable
{
Image image;
public Image Image
class UserInfoPanel : Panel
{
public UserInfoPanel()
{
var layout = new DynamicLayout(this);
layout.Add(new Label
{
Text = "User Info",
Font = new Font(SystemFont.Bold, 15)
@cwensley
cwensley / MyDateTimePickerHandler.cs
Last active December 19, 2015 12:59
Shows how to use a Windows Forms DateTimePicker in the wpf platform of Eto.Forms
using Eto.Forms;
using Eto.Platform.Wpf.Forms;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using swf = System.Windows.Forms;
namespace Eto.Test.Wpf
@cwensley
cwensley / gist:6356887
Created August 27, 2013 18:02
Initialize eto.forms application in an monomac/xamarin.mac host
var app = new Eto.Forms.Application(Generator.Detect);
((Eto.Platform.Mac.Forms.ApplicationHandler)app.Handler).AppDelegate = NSApplication.SharedApplication.Delegate;
var form = new Eto.Forms.Form { Size = new Eto.Drawing.Size(200, 200), Title = "Hello!" };
form.Show();
using System;
using Eto;
using Eto.Forms;
using Eto.Drawing;
namespace SharpSHPBuilder
{
public class MainWindow : Form
{
public MainWindow()
@cwensley
cwensley / gist:162ca757311d22787a31
Last active August 29, 2015 14:02
Set pixels directly in Eto.Drawing.Bitmap
var bitmap = new Bitmap(100, 100, PixelFormat.Format32bppRgb);
using (var bd = bitmap.Lock()) unsafe
{
int* val = (int*)bd.Data;
var pos = new Point(50, 50); // pixel we want to set
val += pos.X + (pos.Y * bd.ScanWidth / 4); // scanwidth is in bytes
*val = bd.TranslateArgbToData(Colors.Blue.ToArgb()); // translate argb to data format (may be different RGB order per platform)
}