Posts


See https://github.com/majorsilence/MajorSilenceConnect

 

MajorSilenceConnect is a basic replacement for ultravnc single click that uses the regular ultravnc server winvnc.exe. I find that this works much better on Windows Vista/7. Requires .NET 2.0. Currently this project only supports the port forwarding setup (does not support repeater mode) because that is all I need. It should be simple enough to add repeater support if it is ever needed. How compile MajorSilenceConnect Source code You need Visual Studio C# 2008. In the resources/helpdesk.xml you will find:

<helpdesk>
    <support>Support 1</support>
    <address>localhost:5500</address>
  </helpdesk>

<support> is what shows in the gui that the client will double click. <address> is the address/port that it will attempt to connect to. http://www.chunkvnc.com/ - for a solution with repeater mode and OSX support. http://uvnc.com/ - UltraVNC http://madebits.com/netz/ - .NET exe compressor


Read the chapter “The Template Method Pattern”. Had a hard time concentrating on this chapter.

To quote the book: “Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Redefine the steps in an algorithm without changing the algorithm’s structure.” Design Patterns Explained chapter 18 page 283.

See http://www.majorsilence.com/design_patterns_explained


Since I believe in its current state DeVeDe will never run as good on Windows as it does on Linux I have decided to write a small clone of the DeVeDe dvd module using .NET.


I am creating an IronPython port of DeVeDe. Progress can be tracked from:
http://majorsilence.com/commitlog?repo=1

I am currently planning on keeping the IronPython port of DeVeDe in sync with the main DeVeDe. I also still plan on packaging the main DeVeDe for Windows.

The IronPython port should have less problems with communicating with the underlying backed applications (IronPython has support for asynchronous sub-process communication built-in) and translations should work again.


This example of using IronPython and Gtk Sharp will show how to do the following:

  • Layouts with Gtk.VBox
  • Gtk.Buttons
  • Gtk.Entry
  • Widget Events (Callbacks)
  • Message Dialogs

For the latest updates check http://majorsilence.com/PyGTK_Book.

To use Gtk Sharp from IronPython first you need to import the clr and add a reference to the gtk-sharp. Once this is finished you can import Gtk. The example below creates one window, adds a Gtk.Entry and Gtk.Button. The button has one event which is the self.HelloWorld function. The self.HelloWorld function displays a MessageDialog that will change the gtk.Entry default value to “Hello World!” if Yes is clicked. A Gtk.VBox is created and added to the window. This vbox is used to pack the self.textentry1 and button vertically. You can also use a Gtk.HBox instead or a combination of Gtk.VBox and Gtk.HBox.

Gtk.Application.Init() must be called before using Gtk and Gtk.Application.Run() starts the Gtk main event loop. The window has the DeleteEvent attached to call the self.DeleteEvent function. The self.DeleteEvent function alls Gtk.Application.Quite() which exits the application.

import clr
clr.AddReference('gtk-sharp')
import Gtk

class GtkExample(object):
	def __init__(self):
		Gtk.Application.Init()
		
		self.window = Gtk.Window("Hello World")
		self.window.DeleteEvent += self.DeleteEvent
		
		vbox = Gtk.VBox() 
		
		button = Gtk.Button("Show Message")
		button.Clicked += self.HelloWorld
		
		self.textentry1 = Gtk.Entry("Default Text")
		
		vbox.PackStart(self.textentry1)
		vbox.PackStart(button)
		
		self.window.Add(vbox)
		self.window.ShowAll()
		Gtk.Application.Run()

	def DeleteEvent(self, widget, event):
		Gtk.Application.Quit()
		
	def HelloWorld(self, widget, event):
		m = Gtk.MessageDialog(None, Gtk.DialogFlags.Modal, Gtk.MessageType.Info, \
			Gtk.ButtonsType.YesNo, False, 'Change the text entry to "Hello World?"')

		result = m.Run()
		m.Destroy()
		if result == int(Gtk.ResponseType.Yes):
			self.textentry1.Text = "Hello World!"
		
	
if __name__ == "__main__":
	GtkExample()