FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
May 01, 2003

Linux and the iPAQ, Arm in Arm

(Page 7 of 9)
May 2003/Linux and the iPAQ, Arm in Arm/Listing 3

Listing 3: Custom widgets can be added to the GTK+ toolkit, such as this numeric keypad widget

#ifndef __NUMBERPAD_H__
#define __NUMBERPAD_H__

#include <gdk/gdk.h>
#include <gtk/gtkvbox.h>

#define NUMBERPAD(obj)     GTK_CHECK_CAST(obj, \
                             numberpad_get_type(), Numberpad)
#define IS_NUMBERPAD(obj) GTK_CHECK_TYPE(obj, \
                             numberpad_get_type())

typedef struct _Numberpad Numberpad;

struct _Numberpad
{
  GtkVBox vbox;
  
  GtkWidget* numberButtons[10];
  GtkWidget* enterButton;
  
  GtkAdjustment* adjustment;
  
  unsigned char numbers[4];
};

guint       numberpad_get_type();
GtkWidget* numberpad_new(GtkAdjustment*);

#endif // __NUMBERPAD_H__

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next Page
RELATED ARTICLES
No Related Articles
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK