small tutorial


Welcome

What is gtkD
Screenshots
sourceforge Page
Contacts

Downloads

gtkD Windows
gtkD Linux

Developers

Tutorial
Diffs to GTK
Events
Class Hierarchy
Class Index
Class List
OpenGL

Links

Site pages
Links
Acknowledgments

introduction
menus
trees and lists
text

introduction

DUI is mostly a 1 to 1 wrapper of GTK+ on a fully OO packaging and so it reflects all it's good and otherwise features.
DUI does have some decorator functions to facilitate it's use, more are planed.
Most of the usage of DUI is straightforward, create widget, add widgets to containers... there is nothing new there and we expect that this is not your first contact with a GUI toolkit. If that's not true a brief look at the GTK+ tutorials might be a good starting point as they are far more complete then DUI documentation.
The completion of a proper DUI manual depends as much on DUI success as DUI success depends on a good manual.

This tutorial is also (mainly) a reference tool for my own use.

menus

        MenuBar menubar = new MenuBar();   // name is self explanatory
        Menu menu;      // idem
        
        menu = menubar.append("_File");

With GTK+ to see a menu on a menu bar we have to:

  • create a new menu item
  • append a new item to the menu bar
  • create a new menu
  • set the new menu as submenu of the new item

that's done by the statement

 menu = menubar.append("_File"); 

after the menu is created to add items to it:
        menu.append(new MenuItem(myMenuItemListener, "E_xit","file.exit"));

where myMenuItemListener is a MenuItemListener.
this will create a new menuItem with "New" as Label and "x" as the menu mnemonic
and sets the myMenuItemListener to listen to the activate signal from the item. the action string if set to "file.exit"

Note:
ItemFactory is not implemented yet

trees and lists

todo

text

todo

SourceForge.net Logo DSource.org Logo digitalmars.com Logo