Tags: gnome

Getting started with gtk♯

Originally published at The Pædantic Programmer. Please leave any comments there.

This is a quick tutorial for getting a first gtk-sharp app up and going.

Install MonoDevelop

$ sudo apt-get install monodevelop libgtk2.0-cil-dev

Start MonoDevelop

It’ll be in your GNOME application menu under Applications->Programming->MonoDevelop

Create a new Gtk# Project

Create New Project

Create New Project

Select Gtk# 2.0 Project

Select Gtk# 2.0 Project

Select Project Features

Select Project Features

Hello World

Hello World

Run project

You can run this boilerplate by pressing Ctrl-F5

Using the Designer

Double-click on the file named MainWindow.cs in the Solution section. When the file opens, click the Designer button below the code view.

The Designer

The Designer

The Toolbox

To add the Toolbox, press Alt-Shift-B or click View->Toolbox.

Drag a VBox widget from the Toolbox to the main window.

Add VBox

Add VBox

Drop a Menu Bar widget into the top cell of the VBox, and a Statusbar into the bottom.

Insert Menu and Status Bar

Insert Menu and Status Bar

Properties grid

Drop a Button widget into the middle cell of the VBox.
Add the Properties grid from the View menu (Alt+Shift+P or View->Properties).
Select the new button by clicking on it.
In the Properties grid, expand the Button Properties section and click the value of the Label field. Delete the default content and replace it with a different string.

Button with new Label

Button with new Label

Adding a Click handler

Select the button in the Designer view
In the Property grid, select the Signals tab
Click twice on the text in the column to the right of the Clicked and replace Click here to add a new handler with MyButtonClickHandler

Add a click handler

Add a click handler

Click on the Source Code button below the viewer window to switch to the C♯ code. You can use the find tool to search for the new handler you created, called MyButtonClickHandler. Ctrl-F will bring up the find dialogue.

Browse to click handler

Browse to click handler

Add some code to update the status bar.

	protected virtual void MyButtonClickHandler (object sender, System.EventArgs e)
	{
		var contextId = this.statusbar1.GetContextId("clicked");
		this.statusbar1.Push(contextId, "Clicky-Clicky" );
	}
Click handler code

Click handler code

Modify button layout

The size of the running window is a little weird. I fixed mine by un-setting the Auto Size boolean and setting the Expand and Fill in the Box Child Layout section of the Properties grid.

Button layout changes

Button layout changes

Exercise button click handler

Run your application with Ctrl-F5 and click on the button. You should see the new string show up in the status bar at the bottom left of the window.

Not yet clicked

Not yet clicked

Clicked + Status update

Clicked + Status update

Add Menu items

Create File Menu Entry

Create File Menu Entry

Create File->Quit Menu Item

Create File->Quit Menu Item

Add Quit event handler

Add Quit event handler

Add Clear Statusbar Activate Handler

Add Clear Statusbar Activate Handler

More DLR work

Originally published at The Pædantic Programmer. Please leave any comments there.

Ivan put up a hudson server on our winders box. Ankit helped me figure out the IronRuby xbuild build problems. I should probably try it on IronPython, too. I sent the ironruby-core list a patch to fix some case sensitivity issues. Some time in the near future, I’m going to get together a bug report for the compiler and send it off to Marek. But I’m tired and Scarlet’s got a friend doing the sleep-over thing tonight.

So. Later ;)

P.S., can you believe that nobody registered a11y.com before now? Crazy talk.

P.P.S., does anyone out there in gnome land have a ruby app they want to test for compatibility with IronRuby?

Font for composing Lushootseed

Originally published at The Pædantic Programmer. Please leave any comments there.

At the recommendation of David Beck, I have installed a TTF font from http://www.languagegeek.com/. It took a few minutes for me to figure out how to get it going, but it was pretty straightforward after that. Here are some quick instructions for those of you running Debian variants such as Ubuntu.

  1. Fetch the zip files from languagegeek.com and unpack:
    $ sudo mkdir -m777 -p /usr/local/share/fonts/truetype/languagegeek/
    $ cd /usr/local/share/fonts/truetype/languagegeek/
    $ for zip in AboriginalSerif.zip AboriginalSans.zip
    do
      wget http://www.languagegeek.com/font/$zip &&
      unzip $zip &&
      rm $zip
    done
    $ sudo chmod -R 755 .
    
  2. Register these fonts with the system using defoma (the debian font manager):
    $ for font in *.ttf
    do
      sudo defoma-font register truetype $PWD/$font
    done
    

While performing the defoma registration, I was presented with a number of warning-ish-looking messages for each file processed. For better or worse, I am ignoring them:

No CIDSupplement specified for Dotum-Bold, defaulting to 0.
No CIDSupplement specified for Batang-Regular, defaulting to 0.
No CIDSupplement specified for ZenHei-CNS, defaulting to 0.
No CIDSupplement specified for Batang-Bold, defaulting to 0.
No CIDSupplement specified for ZenHei, defaulting to 0.
No CIDSupplement specified for Dotum-Regular, defaulting to 0.

I used gnome-appearance-properties (System → Preferences → Appearance) to set my document font to Aboriginal Sans:


After telling Chromium that it should use these fonts, it renders all of the Lushootseed characters quite nicely.


IRC logs for #ubuntu-us-wa

Originally published at The Pædantic Programmer. Please leave any comments there.

Hello, google. I would like to introduce you to our chat logs. Chat logs, google. Google, chat logs.

We will discuss things here such as Mono, GNOME and Debian. We may even use it to talk about work on the DLR project stuff.

Ubuntu Book

The Official Ubuntu Book
Looks like there is now an *official* ubuntu book available. Whee :)

Excerpt from a post to Planet Gnome:


This my friends, is the Official Ubuntu Book and it is out now!

I am really pleased with how the book turned out, and it was a delight to work with Mako, Corey, Jonathan and Ivan. A special thanks should go out to the awesome Debra Williams-Cauley who nurtured the book through every step. The schedule for the book was pretty tight and it was an interesting experience writing a book around software that was not written yet. I remember hanging around #ubuntu-devel getting daily updates about the GUI installer as Colin was writing them. Bleeding edge writing if there ever was.

SuSE / Novell, KDE / GNOME, gtk+ / qt, ximian / trolltech

For those of you who care, there's currently chaos in the community. SuSE users are grumbling about Novell's decision to make Ximian's users interface the "default" desktop.

Novell will continue to ship *both* GNOME and KDE, but instead of doing what it has done since "obtaining" SuSE and Ximian, it will now make GNOME the default desktop.

Good news for me. Not so good news for my friends who develop QT applications that run on the KDE desktop.

I think this stresses how important cooperation in the Free Desktop project is. You can read more about this project, started by a Red Hat developer, Havoc "hp" Pennington at the following URL:

http://freedesktop.org/wiki/

I have been writing GTK+ applications since 2000 and have many times wished that KDE and GNOME tools functioned more similarly or at least inter-operated more smoothly.

Perhaps the QT documentation should be presented in a style that gtk+ developers are familiar with. We keep our API documentation here:

http://developer.gnome.org/doc/API/

Where does the QT API documentation reside?

From this article:

Contrary to what was expected from recent Novell announcements, Novell executives are apparently slicing deeply into the Linux heart of the company. Jobs and resources are actually being slashed in several areas previously dubbed by Novell management as "key component parts of Novell's Linux developments": staffers working on Mono, Hula, Evolution and Desktop Strategy are getting the sack.

Eep! I think that's a couple of my friends losing their jobs.

http://www.linuxtoday.com/it_management/2005111002326OPSSNV

One of my friends at Novell in the group in question tells me "that story is both wrong and old news." So I'm not concerned.

http://www.linuxtoday.com/news_story.php3?ltsn=2005-09-15-009-26-OP-GN-KE
I run... ahem...

Ubuntu GNU/Linux with GNOME on an IBM T42 Thinkpad.

Based on the recent discussions fueled by Linus Torvalds, I look forward to the coming of GNU's multi-server operating system, HURD, which runs on the GNU project's Mach microkernel.

Anyone have any first-hand familiarity with HURD or Mach?

Today I...

Have:

- gone to brunch with Darek
- set up a wireless LAN for the apartment complex
- hooked Oscar up with the GNOME team
- invited Brian Ingerson to Fire Friday
- called Randal's business and attempted to invite him to FF
- invited Ryan to FF
- got an invite from Darek to go to his show tonight at ToST
- helped Darek set up his machine to access the wireless network
- attempted to pay Hannah's traffic ticket (successfully?)
- killed http://colliertech.org
- got colliertech.org back up
- created a base site for Ryan: http://www.ryanbickel.com/
- told Darek about Vinni Blue
- told Darek about Brandon Smith
- set Ryan up with an email address: ryanb@ryanbickel.com

Will:

- clean the cat's litter box
- get new litter
- hug Hannah when she gets home
- go to FF
- drop in to ToST