Posted by admin on May - 6 - 2011
Introduction Our first GTK+ program will be nothing more than a basic window. There are no event handlers, which means that the window will not respond to any user input such as mouse clicks. Although clicking the X button on the title bar to exit the program will cause the [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction The GtkMenuBar, GtkMenu, and GtkMenuItem widgets are used in conjunction with each other to provide drop-down menu lists. The GtkMenuBar is essentially a horizontal packing box for the menu items. Individual GtkMenu widgets such as File and Edit are then packed inside the menu bar. Then, the GtkMenuItem widgets [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction This example covers a container called the GtkVButtonBox. The GtkVButtonBox container is used to group buttons together in a vertical box from top to bottom. From what I can tell, the GtkVButtonBox is designed to contain only buttons. However, you can pack other widgets such as GtkLabel widgets and [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction GtkCheckButton widgets serve the exact same purpose as GtkToggleButtons except that they look differently. Instead of looking like a normal button, GtkCheckButton widgets appear as small check boxes. GtkCheckButton widgets are usually used next to GtkLabels that describe what the option is. Instead of declaring a GtkCheckButton and a [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction The GtkArrow widget draws allows triangular arrows to be drawn on the screen. They can face north, west, south, and east and can be shaded in a variety of ways. Source Code /* *File name: arrow.c */ #include #include /*– This function allows the program to exit properly when [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction This example covers a container called the GtkHPaned widget. The GtkHPaned container is a split plane with right and left sides separated by a divider. By default, the divider can be dragged left or right to alter the size of the split. Source Code /* *File name: hpane.c */ [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction This example produces a simple GTK combo pull-down list. It allows you to add default values to the list. In addition, the user is allowed to enter his/her own value. Screenshot Source Code /* *File name: hbox.c */ #include #include /*– This function allows the program to exit properly [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction This example covers a container called the GtkVPaned widget. The GtkVPaned container is a split plane with top and bottom sections separated by a divider. By default, the divider can be dragged up or down to alter the size of the split. Source Code /* *File name: vpane.c */ [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction In this example, we create a single button and an event handler to respond to mouse clicks on the button. When the Click Me button is clicked, the button_clicked function will send a message to the command line that says “Button was clicked.” Also, the destroyapp function allows the [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction The GtkCalendar widget is used to display a calendar to the screen, one month at a time. For the purpose of this example, we are not setting the date on the calendar. In a real world program, you will want to get the system date and set the date [ Read More ]
Continue