gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
- table = gtk_table_new( 2, 3, TRUE );
+ table = ui::Table( 2, 3, TRUE );
gtk_widget_show( table );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
- table = gtk_table_new( 2, 3, TRUE );
+ table = ui::Table( 2, 3, TRUE );
gtk_widget_show( table );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
- table = gtk_table_new( 2, 3, TRUE );
+ table = ui::Table( 2, 3, TRUE );
gtk_widget_show( table );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
- table = gtk_table_new( 1, 3, TRUE );
+ table = ui::Table( 1, 3, TRUE );
gtk_widget_show( table );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
- table = gtk_table_new( 2, 3, TRUE );
+ table = ui::Table( 2, 3, TRUE );
gtk_widget_show( table );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
- table = gtk_table_new( 2, 3, TRUE );
+ table = ui::Table( 2, 3, TRUE );
gtk_widget_show( table );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
- table = gtk_table_new( 2, 3, TRUE );
+ table = ui::Table( 2, 3, TRUE );
gtk_widget_show( table );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
- table = gtk_table_new( 2, 3, TRUE );
+ table = ui::Table( 2, 3, TRUE );
gtk_widget_show( table );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
// the table
// -------------------------- //
- table = gtk_table_new( 3, 2, FALSE );
+ table = ui::Table( 3, 2, FALSE );
gtk_widget_show( table );
gtk_container_add( GTK_CONTAINER( window ), table );
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
gtk_notebook_set_tab_pos( GTK_NOTEBOOK( notebook ), GTK_POS_TOP );
g_object_set_data( G_OBJECT( dlg ), "notebook", notebook );
- table = gtk_table_new( 2, 2, FALSE );
+ table = ui::Table( 2, 2, FALSE );
gtk_widget_show( table );
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_plane ), GINT_TO_POINTER( i ) );
}
- table2 = gtk_table_new( 4, 2, FALSE );
+ table2 = ui::Table( 4, 2, FALSE );
gtk_widget_show( table2 );
gtk_table_set_row_spacings( GTK_TABLE( table2 ), 5 );
gtk_table_set_col_spacings( GTK_TABLE( table2 ), 5 );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( hbox2 ), frame, TRUE, TRUE, 0 );
- table = gtk_table_new( 3, 4, FALSE );
+ table = ui::Table( 3, 4, FALSE );
gtk_widget_show( table );
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( hbox2 ), frame, TRUE, TRUE, 0 );
- table = gtk_table_new( 2, 2, FALSE );
+ table = ui::Table( 2, 2, FALSE );
gtk_widget_show( table );
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
- table = gtk_table_new( 3, 4, FALSE );
+ table = ui::Table( 3, 4, FALSE );
gtk_widget_show( table );
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "bmp_note", label );
- table = gtk_table_new( 2, 2, FALSE );
+ table = ui::Table( 2, 2, FALSE );
gtk_widget_show( table );
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "bmp_reload", button );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( bitmap_reload ), NULL );
- table = gtk_table_new( 2, 2, TRUE );
+ table = ui::Table( 2, 2, TRUE );
gtk_widget_show( table );
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
gtk_widget_show( label );
gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 );
- table = gtk_table_new( 3, 3, FALSE );
+ table = ui::Table( 3, 3, FALSE );
gtk_widget_show( table );
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), vbox, label );
// ^Fishman - Modified to add more labels and textboxes.
- table = gtk_table_new( 5, 2, FALSE );
+ table = ui::Table( 5, 2, FALSE );
gtk_widget_show( table );
gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_box_pack_start( GTK_BOX( hbox2 ), spin, FALSE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "tex_slant", spin );
- table = gtk_table_new( 2, 4, TRUE );
+ table = ui::Table( 2, 4, TRUE );
gtk_widget_show( table );
gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_box_pack_start( GTK_BOX( hbox ), lw3label, FALSE, TRUE, 0 );
gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnScroll3d ), lw3label );
- table = gtk_table_new( 2, 4, FALSE );
+ table = ui::Table( 2, 4, FALSE );
gtk_widget_show( table );
gtk_box_pack_start( GTK_BOX( vbox2 ), table, TRUE, TRUE, 0 );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
GTK_SIGNAL_FUNC( OnSelchangeZbuffer ), GINT_TO_POINTER( 2 ) );
gtk_menu_append( GTK_MENU( menu ), item );
- table = gtk_table_new( 2, 2, FALSE );
+ table = ui::Table( 2, 2, FALSE );
gtk_widget_show( table );
gtk_box_pack_start( GTK_BOX( vbox2 ), table, TRUE, TRUE, 0 );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_box_pack_start( GTK_BOX( vbox ), gtk_hseparator_new(), FALSE, FALSE, 2 ); // insert separator into vbox
- table = gtk_table_new( 4, 3, TRUE ); // create table
+ table = ui::Table( 4, 3, TRUE ); // create table
gtk_table_set_row_spacings( GTK_TABLE( table ), 8 ); // set row spacings
gtk_table_set_col_spacings( GTK_TABLE( table ), 8 ); // set column spacings
gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, FALSE, 2 ); // insert table into vbox
}
GtkTable* create_dialog_table( unsigned int rows, unsigned int columns, unsigned int row_spacing, unsigned int col_spacing, int border ){
- GtkTable* table = GTK_TABLE( gtk_table_new( rows, columns, FALSE ) );
+ GtkTable* table = ui::Table( rows, columns, FALSE );
gtk_widget_show( GTK_WIDGET( table ) );
gtk_table_set_row_spacings( table, row_spacing );
gtk_table_set_col_spacings( table, col_spacing );
}
GtkTable* DialogRow_new( const char* name, GtkWidget* widget ){
- GtkTable* table = GTK_TABLE( gtk_table_new( 1, 3, TRUE ) );
+ GtkTable* table = ui::Table( 1, 3, TRUE );
gtk_widget_show( GTK_WIDGET( table ) );
gtk_table_set_col_spacings( table, 4 );
ScrolledWindow::ScrolledWindow() : ScrolledWindow(GTK_SCROLLED_WINDOW(gtk_scrolled_window_new(nullptr, nullptr)))
{ }
+ Table::Table(std::size_t rows, std::size_t columns, bool homogenous) : Table(GTK_TABLE(gtk_table_new(rows, columns, homogenous)))
+ { }
+
TreeView::TreeView(TreeModel model) : TreeView(GTK_TREE_VIEW(gtk_tree_view_new_with_model(model)))
{ }
using ui_menuitem = struct _GtkMenuItem;
using ui_modal = struct ModalDialog;
using ui_scrolledwindow = struct _GtkScrolledWindow;
+using ui_table = struct _GtkTable;
using ui_treemodel = struct _GtkTreeModel;
using ui_treeview = struct _GtkTreeView;
using ui_typeinst = struct _GTypeInstance;
ScrolledWindow();
);
+ WRAP(Table, Widget, ui_table,
+ Table(std::size_t rows, std::size_t columns, bool homogenous);
+ );
+
WRAP(SpinButton, Widget, ui_widget,);
WRAP(TreeModel, Widget, ui_treemodel,);
}
void Dialog::addRadioIcons( ui::Widget vbox, const char* name, StringArrayRange icons, const IntImportCallback& importViewer, const IntExportCallback& exportViewer ){
- ui::Widget table = ui::Widget(gtk_table_new( 2, static_cast<guint>( icons.last - icons.first ), FALSE ));
+ ui::Widget table = ui::Table( 2, icons.last - icons.first, FALSE );
gtk_widget_show( table );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
{
// Spawnflags (4 colums wide max, or window gets too wide.)
- GtkTable* table = GTK_TABLE( gtk_table_new( 4, 4, FALSE ) );
+ GtkTable* table = ui::Table( 4, 4, FALSE );
gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( table ), FALSE, TRUE, 0 );
gtk_widget_show( GTK_WIDGET( table ) );
{
// key/value entry
- GtkTable* table = GTK_TABLE( gtk_table_new( 2, 2, FALSE ) );
+ GtkTable* table = ui::Table( 2, 2, FALSE );
gtk_widget_show( GTK_WIDGET( table ) );
gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( table ), FALSE, TRUE, 0 );
gtk_table_set_row_spacings( table, 3 );
gtk_widget_show( vbox );
gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 );
- table = ui::Widget(gtk_table_new( 2, 2, FALSE ));
+ table = ui::Table( 2, 2, FALSE );
gtk_widget_show( table );
gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
}
ui::Widget create_main_statusbar( ui::Widget pStatusLabel[c_count_status] ){
- GtkTable* table = GTK_TABLE( gtk_table_new( 1, c_count_status, FALSE ) );
+ GtkTable* table = ui::Table( 1, c_count_status, FALSE );
gtk_widget_show( GTK_WIDGET( table ) );
{
gtk_widget_show( GTK_WIDGET( vbox3 ) );
gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
{
- GtkTable* table = GTK_TABLE( gtk_table_new( 2, 2, FALSE ) );
+ GtkTable* table = ui::Table( 2, 2, FALSE );
gtk_widget_show( GTK_WIDGET( table ) );
gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
gtk_table_set_row_spacings( table, 5 );
m_pColCombo = combo;
}
}
- GtkTable* table = GTK_TABLE( gtk_table_new( 5, 2, FALSE ) );
+ GtkTable* table = ui::Table( 5, 2, FALSE );
gtk_widget_show( GTK_WIDGET( table ) );
gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
gtk_table_set_row_spacings( table, 5 );
gtk_widget_show( GTK_WIDGET( vbox3 ) );
gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
{
- GtkTable* table = GTK_TABLE( gtk_table_new( 3, 2, FALSE ) );
+ GtkTable* table = ui::Table( 3, 2, FALSE );
gtk_widget_show( GTK_WIDGET( table ) );
gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
gtk_table_set_row_spacings( table, 5 );
g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
}
{
- GtkTable* table = GTK_TABLE( gtk_table_new( 5, 4, FALSE ) );
+ GtkTable* table = ui::Table( 5, 4, FALSE );
gtk_widget_show( GTK_WIDGET( table ) );
gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
gtk_table_set_row_spacings( table, 5 );
gtk_container_add( GTK_CONTAINER( hbox ), GTK_WIDGET( radio_vbox ) );
{
- GtkTable* table = GTK_TABLE( gtk_table_new( 5, 2, FALSE ) );
+ GtkTable* table = ui::Table( 5, 2, FALSE );
gtk_widget_show( GTK_WIDGET( table ) );
gtk_box_pack_start( GTK_BOX( radio_vbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
gtk_table_set_row_spacings( table, 5 );
{
- ui::Widget table = ui::Widget(gtk_table_new( 6, 4, FALSE ));
+ ui::Widget table = ui::Table( 6, 4, FALSE );
gtk_widget_show( table );
gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( table ), FALSE, FALSE, 0 );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), FALSE, FALSE, 0 );
{
- ui::Widget table = ui::Widget(gtk_table_new( 4, 4, FALSE ));
+ ui::Widget table = ui::Table( 4, 4, FALSE );
gtk_widget_show( table );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_widget_show( GTK_WIDGET( vbox3 ) );
gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
{
- GtkTable* table = GTK_TABLE( gtk_table_new( 8, 4, FALSE ) );
+ GtkTable* table = ui::Table( 8, 4, FALSE );
gtk_widget_show( GTK_WIDGET( table ) );
gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
gtk_table_set_row_spacings( table, 0 );
gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
{
- GtkTable* table = GTK_TABLE( gtk_table_new( 8, 4, FALSE ) );
+ GtkTable* table = ui::Table( 8, 4, FALSE );
gtk_widget_show( GTK_WIDGET( table ) );
gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
gtk_table_set_row_spacings( table, 0 );
g_TextureBrowser.m_parent = toplevel;
- ui::Widget table = ui::Widget(gtk_table_new( 3, 3, FALSE ));
+ ui::Widget table = ui::Table( 3, 3, FALSE );
ui::Widget frame_table;
ui::Widget vbox = ui::VBox( FALSE, 0 );
gtk_table_attach( GTK_TABLE( table ), vbox, 0, 1, 1, 3, GTK_FILL, GTK_FILL, 0, 0 );
gtk_box_pack_end( GTK_BOX( vbox ), g_TextureBrowser.m_search_button, FALSE, FALSE, 0 );
}
{ // Tag frame
- frame_table = ui::Widget(gtk_table_new( 3, 3, FALSE ));
+ frame_table = ui::Table( 3, 3, FALSE );
g_TextureBrowser.m_tag_frame = ui::Widget(gtk_frame_new( "Tag assignment" ));
gtk_frame_set_label_align( GTK_FRAME( g_TextureBrowser.m_tag_frame ), 0.5, 0.5 );