SWT: Datetime Widget on top of Spinner [ Progress Report]

What is the problem with DateTime widget ?

Datetime is an SWT widget that shows DATE/TIME/CALENDAR, so overall very useful widget!

In current version of SWT  it looks like this:

So as you might have guessed DateTime  is a Composite of Text, Button with Arrow Up and Button  with Arrow Down. All this elements are separate widgets that are brought together to work synchronously at the time when widget is created. The problem is that creating a separate widget for every element and making all these widgets work together takes a lot of resources.

Also, If I use some weird GTK+ theme (Gnome-Cuepertino in screenshot) my Arrows on the buttons become invisible:


Finally, if we take a look at other widget with similar functionality (Spinner photo below) we may see that it has different buttons, so there is no consistency between widgets in SWT.


Is there an alternative solution ?

One of the possible solutions that we (Red Hat Eclipse Team) have proposed is to use Spinner widget as a back-end for DateTime widget.

Why to use Spinner ?

1. It has 2 buttons and a Text area, and all this works together by single widget. (Less resources required)
2. Spinner buttons are part of the Spinner itself, so they won’t disappear if you change to some weird theme3. Spinner and DateTime will have similar look, which will create consistency

So the next question would be:

What was being done on this front ?

I have been working on  migrating the  DateTime widget to Spinner couple of months ago, but due a lot of other work that was supposed to be done and long review time, this work was put into a shelf. However recently, when most of the crucial work on GTK+ 3 was done, I have decided to come back to it, and some significant progress was achieved.

So here is the first look of how DateTime may look when running on top of Spinner:

Theme Adwaita (GTK+ 2):
datetime_newAs you might see it still has Text area and Buttons, but they act as a single widget this time. (less resources needed)

So if I try to look at the same widget using some weird GTK+ theme (again Gnome-Cuepertino), you still can see buttons:


Finally if we take a  look at the  Spinner widget  next to DateTime widget:


You can see the consistency 🙂
I will continue working on it, and hopefully soon it will take its place in the SWT family.

I will keep you updated!



About Anatoly Spektor

My name is Anatoly Spektor (originally Anatolijs Spektors) I am Software and Web Developer. I have worked in Seneca Center for Development of Open Technology on Big Blue Button Add-on - Polling Module, Red Hat and some other places :) I am an author of the book 'Eclipse Debugging How To', Muay Thai fighter and amateur photographer ;)
This entry was posted in Eclipse Development, Fedora, My Work, open-source, OS, Programming Languages, Red Hat, SWT and tagged , , , , , , . Bookmark the permalink.

One Response to SWT: Datetime Widget on top of Spinner [ Progress Report]

  1. John says:

    First time into your blog and got fascinated by GTK+, though had heard about it, some of my php friends were talking about it. But nice to know that it has got cool visual components to be used in front end. Though it is not much of my use because I am a VB programmer. But its nice to see some great work being done in open-source space.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s