Posted by admin on May - 5 - 2011
Introduction The GtkFileSelection widget allows for GTK+ programs that utilize it to have a consistent file dialog window. The standard GtkFileSelection widget can be extended and customized, but for the purpose of this example, we are using the standard file dialog box. Once you have compiled and run the program, [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction In this example, we create a simple text label. The GtkLabel is a not-editable text field that is usually used to provide names or descriptions for other widgets. In future programs, we will use labels next to other widgets like single line text areas and drop down lists. There’s [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction This example is similar to the example for GtkText except that here we have added horizontal and vertical scrollbars. Also, in the GtkText example, we packed the text area directly inside the main window. That won’t work here because we have more than one widget to show. In this [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction A special set of GTK+ widgets called containers allow the programmer to control the placement of GTK+ widgets on the screen. Individual GTK+ widgets such as buttons and text area are grouped together into one or more containers. The containers are then grouped together inside a parent container such [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction This example covers a container called the GtkHButtonBox. The GtkHButtonBox container is used to group buttons together in a horizontal box from left to right. From what I can tell, the GtkHButtonBox 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 In this example, we will look at a very simple container called the GtkHBox. The GtkHBox container is used to group widgets in a horizontal box from left to right and can contain any kind of GTK+ widget. In this example, the GtkHBox contains three GtkLabel widgets and three [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction This example produces a GTK Color Selection Area. It allows the user to choose any color value from a color wheel or by typing in the RGB values. Source Code /* *File name: colorselection.c */ #include #include /*– This function allows the program to exit properly when the window [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction Radio buttons are used to give the user one choice among many options. Only one option can be selected at any given time, and selecting another option will automatically deselect whatever current option is active. This is accomplished with a group of GtkRadioButton widgets. Creating a group is achieved [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction In this example, we create a multi-line text area that the user can type in. It is possible to create a read-only text area, but the text area in this example is editable. If we added a menu bar, a toolbar, and the code to do a few basic [ Read More ]
Continue
Posted by admin on May - 5 - 2011
Introduction Toggle buttons allow the user to set a button to on or off. Unlike radio buttons where only one button out of a group of buttons can be selected, toggle buttons can be set to on or off individually. GtkToggleButtons are easy to work with. They have all the [ Read More ]
Continue