Monday Jul 27, 2009

Last week I populated the ptop-gtk repository, which holds a Gtk based interface for PowerTOP I've been developing over the last couple of months on my spare time. This new interface is enabled with the -G command line option, and it accepts all the existing options.

The motivation for the new interface is quite simple: increase the density of information displayed to the user. The current curses based interface is very limiting as far as that goes - not to mention a pita to maintain. Yes, it looks pretty, but looks aren't everything ;). I personally think we can take a few generally simple steps with various tools to enhance user experience.

The first tab simply shows what you already get with the current interface, allowing more information than the latter. The second tab displays moving area graphs for idle and frequency states, and a graph for the event report.

A couple of screenshots:

This is still in early development, I've been pushing it along as time allows. I'm writing a Gtk widget for periodic graphs, which is extended by another widget for DTrace based graphs. These widgets allow a very simple plug and play into DTrace consumers, just instantiate one, point the it to the data and it will do the job.

There a number of simple bugs that need to be fixed, but it's a relatively good start. I don't know when it will be ready for putback into snv, like I said, it needs work and it's not a very high priority at the moment. On the same subject, I'm not sure Gtk should be a dependency for ON builds, maybe the right place for this is in another consolidation. I don't know yet.

As always, questions/comments/suggestions are more than welcome.

Enjoy !

Tuesday May 26, 2009

I recently started playing with gtk on OpenSolaris and thought I'd post here the couple of packages you need to install to compile a simple gtk app. Took me a few minutes searching the web, would've been nice to get it all in one place. I'm running 2008.11 with the latest build, snv_111. Given a short piece of code using gtk, like this one from the gtk tutorial:
#include <gtk/gtk.h>

int main(int argc, char **argv)
{
	GtkWidget *window;

	gtk_init(&argc, &argv);

	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

	gtk_widget_show(window);

	gtk_main();
	
	return 0;
}
you'll need to install SUNWgnome-common-devel (for pkg-config), SUNWxwinc and SUNWxorg-headers (for header files). So just
# pfexec pkg install SUNWgnome-common-devel SUNWxwinc SUNWxorg-headers
and then
 # cc gtk_1.c -o gtk_1 `pkg-config --cflags --libs gtk+-2.0`
and you're set.

This blog copyright 2009 by rv