Adding, Moving, and Removing Notebook Pages
Each page of a notebook has two elements the tab and the content. The page tab is usually a string that describes the contents of the page. The tab is the main method by which a user will select a page. The content of the page can be anything. Usually, the content that is added directly to the page is some sort of container. A page can be added at the beginning of a notebook, at the end of a notebook, or anywhere in between using the methods prepend_page, append_page, and insert_page,...
// ... 16
save reset Modify the button's style. style save- gt style- gt copy Change the normal state. Set the background color to dark blue. blue new GdkColor parse ' 0A0A6A' style- gt bg Gtk STATE_NORMAL blue Make the prelight color white. style- gt bg Gtk STATE_PRELIGHT style- gt white Set the style. save- gt set_style style The label inside the button must be changed too. style new GtkStyle Change the normal and prelight states. style- gt fg Gtk STATE_NORMAL style- gt white style- gt fg Gtk...
Summary 13
To receive drop data, a widget must be set as a destination. This is a simple matter of calling drag_dest_set. Of course, the widget must also be set up to handle the incoming data, and that can be done by creating a signal handler for the drag-data-received signal. A source of drop data is created using drag_source_set. The data that a source gives to the destination needs to be set in the signal handler for the drag-data-get signal. DnD is a powerful means to make an application more...
Drag Destination Targets
The second argument to drag_dest_set targets is an array of targets that the widget should accept. The targets are not specific items, but rather types of items. Each element of the array is called a target entry. Each target entry is itself an array consisting of a string and two integers. The string indicates the MIME type of the data that is acceptable to drop in the destination widget. Listing 13-1 sets this to text uri-list. This means that only lists of URIs strings that give the location...