void Update_TextureReseter();
-static void dialog_button_callback_texreset_update( GtkWidget *widget, gpointer data ){
+static void dialog_button_callback_texreset_update(ui::Widget widget, gpointer data ){
Update_TextureReseter();
}
gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editRotation ), check );
}
-static void dialog_button_callback( GtkWidget *widget, gpointer data ){
- GtkWidget *parent;
+static void dialog_button_callback( ui::Widget widget, gpointer data ){
int *loop;
EMessageBoxReturn *ret;
- parent = gtk_widget_get_toplevel( widget );
+ auto parent = widget.window();
loop = (int*)g_object_get_data( G_OBJECT( parent ), "loop" );
ret = (EMessageBoxReturn*)g_object_get_data( G_OBJECT( parent ), "ret" );
return TRUE;
}
-static void dialog_button_callback_settex( GtkWidget *widget, gpointer data ){
+static void dialog_button_callback_settex(ui::Widget widget, gpointer data ){
TwinWidget* tw = (TwinWidget*)data;
- GtkEntry* entry = GTK_ENTRY( tw->one );
- auto* combo = GTK_BIN(tw->two);
+ auto entry = ui::Entry::from( tw->one );
+ auto combo = tw->two;
const gchar *tex = gtk_entry_get_text(GTK_ENTRY (gtk_bin_get_child(combo)));
gtk_entry_set_text( entry, tex );
auto window = ui::Window( ui::window_type::TOP );
window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
- gtk_window_set_title( GTK_WINDOW( window ), lpCaption );
+ gtk_window_set_title( window, lpCaption );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop );
g_object_set_data( G_OBJECT( window ), "ret", &ret );
gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT );
w.show();
- w = ui::Widget(gtk_hseparator_new());
+ w = ui::Widget::from(gtk_hseparator_new());
vbox.pack_start( w, FALSE, FALSE, 2 );
w.show();
ret = eIDNO;
}
- gtk_window_set_position( GTK_WINDOW( window ),GTK_WIN_POS_CENTER );
+ gtk_window_set_position( window, GTK_WIN_POS_CENTER );
window.show();
gtk_grab_add( window );
window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
- gtk_window_set_title( GTK_WINDOW( window ), "Intersect" );
+ gtk_window_set_title( window, "Intersect" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop );
// ---- vbox ----
- auto radio1 = ui::Widget(gtk_radio_button_new_with_label( NULL, "Use Whole Map" ));
+ auto radio1 = ui::Widget::from(gtk_radio_button_new_with_label( NULL, "Use Whole Map" ));
vbox.pack_start( radio1, FALSE, FALSE, 2 );
radio1.show();
- auto radio2 = ui::Widget(gtk_radio_button_new_with_label( gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio1)), "Use Selected Brushes" ));
+ auto radio2 = ui::Widget::from(gtk_radio_button_new_with_label( gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio1)), "Use Selected Brushes" ));
vbox.pack_start( radio2, FALSE, FALSE, 2 );
radio2.show();
- auto hsep = ui::Widget(gtk_hseparator_new());
+ auto hsep = ui::Widget::from(gtk_hseparator_new());
vbox.pack_start( hsep, FALSE, FALSE, 2 );
hsep.show();
// ---- /vbox ----
- gtk_window_set_position( GTK_WINDOW( window ),GTK_WIN_POS_CENTER );
+ gtk_window_set_position( window, GTK_WIN_POS_CENTER );
window.show();
gtk_grab_add( window );
window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
- gtk_window_set_title( GTK_WINDOW( window ), "Polygon Builder" );
+ gtk_window_set_title( window, "Polygon Builder" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop );
// ---- hbox2 ----
auto text1 = ui::Entry( 256 );
- gtk_entry_set_text( (GtkEntry*)text1, "3" );
+ gtk_entry_set_text( text1, "3" );
hbox2.pack_start( text1, FALSE, FALSE, 2 );
text1.show();
// ---- hbox2 ----
auto text2 = ui::Entry( 256 );
- gtk_entry_set_text( (GtkEntry*)text2, "8" );
+ gtk_entry_set_text( text2, "8" );
hbox2.pack_start( text2, FALSE, FALSE, 2 );
text2.show();
// ---- /vbox ----
- gtk_window_set_position( GTK_WINDOW( window ),GTK_WIN_POS_CENTER );
+ gtk_window_set_position( window, GTK_WIN_POS_CENTER );
window.show();
gtk_grab_add( window );
rs->bInverse = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(check2) ) ? true : false;
rs->bAlignTop = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(check3) ) ? true : false;
- if ( !ValidateTextIntRange( gtk_entry_get_text( (GtkEntry*)text1 ), 3, 32, "Number Of Sides", &rs->nSides ) ) {
+ if ( !ValidateTextIntRange( gtk_entry_get_text( text1 ), 3, 32, "Number Of Sides", &rs->nSides ) ) {
dialogError = TRUE;
}
if ( rs->bUseBorder ) {
- if ( !ValidateTextIntRange( gtk_entry_get_text( (GtkEntry*)text2 ), 8, 256, "Border Width", &rs->nBorderWidth ) ) {
+ if ( !ValidateTextIntRange( gtk_entry_get_text( text2 ), 8, 256, "Border Width", &rs->nBorderWidth ) ) {
dialogError = TRUE;
}
}
window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
- gtk_window_set_title( GTK_WINDOW( window ), "Stair Builder" );
+ gtk_window_set_title( window, "Stair Builder" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
hbox.pack_start( w, FALSE, FALSE, 0 ); // not entirely sure on all the parameters / what they do ...
w.show();
- w = ui::Widget(gtk_hseparator_new());
+ w = ui::Widget::from(gtk_hseparator_new());
vbox.pack_start( w, FALSE, FALSE, 0 );
w.show();
// djbob: actually it looks very nice :), slightly better than the way i did it
// edit: actually it doesn't work :P, you must pass the last radio item each time, ugh
- auto radioNorth = ui::Widget(gtk_radio_button_new_with_label( NULL, "North" ));
+ auto radioNorth = ui::Widget::from(gtk_radio_button_new_with_label( NULL, "North" ));
hbox.pack_start( radioNorth, FALSE, FALSE, 3 );
radioNorth.show();
radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioNorth ) );
- auto radioSouth = ui::Widget(gtk_radio_button_new_with_label( radioDirection, "South" ));
+ auto radioSouth = ui::Widget::from(gtk_radio_button_new_with_label( radioDirection, "South" ));
hbox.pack_start( radioSouth, FALSE, FALSE, 2 );
radioSouth.show();
radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioSouth ) );
- auto radioEast = ui::Widget(gtk_radio_button_new_with_label( radioDirection, "East" ));
+ auto radioEast = ui::Widget::from(gtk_radio_button_new_with_label( radioDirection, "East" ));
hbox.pack_start( radioEast, FALSE, FALSE, 1 );
radioEast.show();
radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioEast ) );
- auto radioWest = ui::Widget(gtk_radio_button_new_with_label( radioDirection, "West" ));
+ auto radioWest = ui::Widget::from(gtk_radio_button_new_with_label( radioDirection, "West" ));
hbox.pack_start( radioWest, FALSE, FALSE, 0 );
radioWest.show();
vbox.pack_start( hbox, FALSE, FALSE, 0 );
hbox.show();
- auto radioOldStyle = ui::Widget(gtk_radio_button_new_with_label( NULL, "Original" ));
+ auto radioOldStyle = ui::Widget::from(gtk_radio_button_new_with_label( NULL, "Original" ));
hbox.pack_start( radioOldStyle, FALSE, FALSE, 0 );
radioOldStyle.show();
radioStyle = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioOldStyle ) );
- auto radioBobStyle = ui::Widget(gtk_radio_button_new_with_label( radioStyle, "Bob's Style" ));
+ auto radioBobStyle = ui::Widget::from(gtk_radio_button_new_with_label( radioStyle, "Bob's Style" ));
hbox.pack_start( radioBobStyle, FALSE, FALSE, 0 );
radioBobStyle.show();
radioStyle = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioBobStyle ) );
- auto radioCornerStyle = ui::Widget(gtk_radio_button_new_with_label( radioStyle, "Corner Style" ));
+ auto radioCornerStyle = ui::Widget::from(gtk_radio_button_new_with_label( radioStyle, "Corner Style" ));
hbox.pack_start( radioCornerStyle, FALSE, FALSE, 0 );
radioCornerStyle.show();
w.show();
// -------------------------- //
- w = ui::Widget(gtk_hseparator_new());
+ w = ui::Widget::from(gtk_hseparator_new());
vbox.pack_start( w, FALSE, FALSE, 0 );
w.show();
ret = eIDCANCEL;
// +djbob: need our "little" modal loop mars :P
- gtk_window_set_position( GTK_WINDOW( window ),GTK_WIN_POS_CENTER );
+ gtk_window_set_position( window, GTK_WIN_POS_CENTER );
window.show();
gtk_grab_add( window );
if ( ret == eIDOK ) {
rs->bUseDetail = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(checkUseDetail) ) ? true : false;
- strcpy( rs->riserTexture, gtk_entry_get_text( (GtkEntry*)textRiserTex ) );
- strcpy( rs->mainTexture, gtk_entry_get_text( (GtkEntry*)textMainTex ) );
+ strcpy( rs->riserTexture, gtk_entry_get_text( textRiserTex ) );
+ strcpy( rs->mainTexture, gtk_entry_get_text( textMainTex ) );
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(radioNorth) ) ) {
rs->direction = MOVE_NORTH;
rs->direction = MOVE_WEST;
}
- if ( !ValidateTextInt( gtk_entry_get_text( (GtkEntry*)textStairHeight ), "Stair Height", &rs->stairHeight ) ) {
+ if ( !ValidateTextInt( gtk_entry_get_text( textStairHeight ), "Stair Height", &rs->stairHeight ) ) {
dialogError = TRUE;
}
window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
- gtk_window_set_title( GTK_WINDOW( window ), "Door Builder" );
+ gtk_window_set_title( window, "Door Builder" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
gtk_widget_realize( window );
char buffer[256];
- ui::ListStore listMainTextures = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
- ui::ListStore listTrimTextures = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
+ auto listMainTextures = ui::ListStore::from(gtk_list_store_new( 1, G_TYPE_STRING ));
+ auto listTrimTextures = ui::ListStore::from(gtk_list_store_new( 1, G_TYPE_STRING ));
LoadGList( GetFilename( buffer, "plugins/bt/door-tex.txt" ), listMainTextures );
LoadGList( GetFilename( buffer, "plugins/bt/door-tex-trim.txt" ), listTrimTextures );
// djbob: lists added
- auto comboMain = ui::ComboBox(GTK_COMBO_BOX(gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(listMainTextures))));
+ auto comboMain = ui::ComboBox::from(gtk_combo_box_new_with_model_and_entry(listMainTextures));
gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(comboMain), 0);
hbox.pack_start( comboMain, FALSE, FALSE, 0 );
comboMain.show();
vbox.pack_start( hbox, FALSE, FALSE, 0 );
hbox.show();
- auto comboTrim = ui::ComboBox(GTK_COMBO_BOX(gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(listTrimTextures))));
+ auto comboTrim = ui::ComboBox::from(gtk_combo_box_new_with_model_and_entry(listTrimTextures));
gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(comboMain), 0);
hbox.pack_start( comboTrim, FALSE, FALSE, 0 );
comboTrim.show();
w.show();
// argh more radio buttons!
- auto radioNS = ui::Widget(gtk_radio_button_new_with_label( NULL, "North - South" ));
+ auto radioNS = ui::Widget::from(gtk_radio_button_new_with_label( NULL, "North - South" ));
hbox.pack_start( radioNS, FALSE, FALSE, 0 );
radioNS.show();
radioOrientation = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioNS ) );
- auto radioEW = ui::Widget(gtk_radio_button_new_with_label( radioOrientation, "East - West" ));
+ auto radioEW = ui::Widget::from(gtk_radio_button_new_with_label( radioOrientation, "East - West" ));
hbox.pack_start( radioEW, FALSE, FALSE, 0 );
radioEW.show();
// ----------------- //
- w = ui::Widget(gtk_hseparator_new());
+ w = ui::Widget::from(gtk_hseparator_new());
vbox.pack_start( w, FALSE, FALSE, 0 );
w.show();
// ----------------- //
//+djbob
- gtk_window_set_position( GTK_WINDOW( window ),GTK_WIN_POS_CENTER );
+ gtk_window_set_position( window, GTK_WIN_POS_CENTER );
window.show();
gtk_grab_add( window );
window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
- gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" );
+ gtk_window_set_title( window, "Texture Reset" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop );
// ---- /hbox ----
- w = ui::Widget(gtk_hseparator_new());
+ w = ui::Widget::from(gtk_hseparator_new());
vbox.pack_start( w, FALSE, FALSE, 0 );
w.show();
// ----------------- //
- w = ui::Widget(gtk_hseparator_new());
+ w = ui::Widget::from(gtk_hseparator_new());
vbox.pack_start( w, FALSE, FALSE, 0 );
w.show();
// ----------------- //
- gtk_window_set_position( GTK_WINDOW( window ),GTK_WIN_POS_CENTER );
+ gtk_window_set_position( window, GTK_WIN_POS_CENTER );
window.show();
gtk_grab_add( window );
window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
- gtk_window_set_title( GTK_WINDOW( window ), "CTF Colour Changer" );
+ gtk_window_set_title( window, "CTF Colour Changer" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop );
// ---- /vbox ----
- gtk_window_set_position( GTK_WINDOW( window ),GTK_WIN_POS_CENTER );
+ gtk_window_set_position( window, GTK_WIN_POS_CENTER );
window.show();
gtk_grab_add( window );
window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
- gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" );
+ gtk_window_set_title( window, "Texture Reset" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop );
auto table = ui::Table( 2, 3, TRUE );
table.show();
frame.add(table);
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
+ gtk_table_set_row_spacings(table, 5);
+ gtk_table_set_col_spacings(table, 5);
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
// ---- frame ----
dlgTexReset.cbTexChange = ui::CheckButton( "Enabled" );
dlgTexReset.cbTexChange.connect( "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
dlgTexReset.cbTexChange.show();
- gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbTexChange, 0, 1, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(dlgTexReset.cbTexChange, {0, 1, 0, 1}, {GTK_FILL, 0});
w = ui::Label( "Old Name: " );
- gtk_table_attach( GTK_TABLE( table ), w, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(w, {1, 2, 0, 1}, {GTK_FILL, 0});
w.show();
dlgTexReset.editTexOld = ui::Entry( 256 );
gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editTexOld ), rs->textureName );
- gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editTexOld, 2, 3, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(dlgTexReset.editTexOld, {2, 3, 0, 1}, {GTK_FILL, 0});
dlgTexReset.editTexOld.show();
w = ui::Label( "New Name: " );
- gtk_table_attach( GTK_TABLE( table ), w, 1, 2, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(w, {1, 2, 1, 2}, {GTK_FILL, 0});
w.show();
dlgTexReset.editTexNew = ui::Entry( 256 );
gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editTexNew ), rs->textureName );
- gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editTexNew, 2, 3, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(dlgTexReset.editTexNew, {2, 3, 1, 2}, {GTK_FILL, 0});
dlgTexReset.editTexNew.show();
// ---- /frame ----
table = ui::Table( 2, 3, TRUE );
table.show();
frame.add(table);
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
+ gtk_table_set_row_spacings(table, 5);
+ gtk_table_set_col_spacings(table, 5);
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
// ---- frame ----
dlgTexReset.cbScaleHor = ui::CheckButton( "Enabled" );
dlgTexReset.cbScaleHor.connect( "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
dlgTexReset.cbScaleHor.show();
- gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbScaleHor, 0, 1, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(dlgTexReset.cbScaleHor, {0, 1, 0, 1}, {GTK_FILL, 0});
w = ui::Label( "New Horizontal Scale: " );
- gtk_table_attach( GTK_TABLE( table ), w, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(w, {1, 2, 0, 1}, {GTK_FILL, 0});
w.show();
dlgTexReset.editScaleHor = ui::Entry( 256 );
gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editScaleHor ), "0.5" );
- gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editScaleHor, 2, 3, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(dlgTexReset.editScaleHor, {2, 3, 0, 1}, {GTK_FILL, 0});
dlgTexReset.editScaleHor.show();
dlgTexReset.cbScaleVert = ui::CheckButton( "Enabled" );
dlgTexReset.cbScaleVert.connect( "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
dlgTexReset.cbScaleVert.show();
- gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbScaleVert, 0, 1, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(dlgTexReset.cbScaleVert, {0, 1, 1, 2}, {GTK_FILL, 0});
w = ui::Label( "New Vertical Scale: " );
- gtk_table_attach( GTK_TABLE( table ), w, 1, 2, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(w, {1, 2, 1, 2}, {GTK_FILL, 0});
w.show();
dlgTexReset.editScaleVert = ui::Entry( 256 );
gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editScaleVert ), "0.5" );
- gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editScaleVert, 2, 3, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(dlgTexReset.editScaleVert, {2, 3, 1, 2}, {GTK_FILL, 0});
dlgTexReset.editScaleVert.show();
// ---- /frame ----
table = ui::Table( 2, 3, TRUE );
table.show();
frame.add(table);
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
+ gtk_table_set_row_spacings(table, 5);
+ gtk_table_set_col_spacings(table, 5);
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
// ---- frame ----
dlgTexReset.cbShiftHor = ui::CheckButton( "Enabled" );
dlgTexReset.cbShiftHor.connect( "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
dlgTexReset.cbShiftHor.show();
- gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbShiftHor, 0, 1, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(dlgTexReset.cbShiftHor, {0, 1, 0, 1}, {GTK_FILL, 0});
w = ui::Label( "New Horizontal Shift: " );
- gtk_table_attach( GTK_TABLE( table ), w, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(w, {1, 2, 0, 1}, {GTK_FILL, 0});
w.show();
dlgTexReset.editShiftHor = ui::Entry( 256 );
gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editShiftHor ), "0" );
- gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editShiftHor, 2, 3, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(dlgTexReset.editShiftHor, {2, 3, 0, 1}, {GTK_FILL, 0});
dlgTexReset.editShiftHor.show();
dlgTexReset.cbShiftVert = ui::CheckButton( "Enabled" );
dlgTexReset.cbShiftVert.connect( "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
dlgTexReset.cbShiftVert.show();
- gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbShiftVert, 0, 1, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(dlgTexReset.cbShiftVert, {0, 1, 1, 2}, {GTK_FILL, 0});
w = ui::Label( "New Vertical Shift: " );
- gtk_table_attach( GTK_TABLE( table ), w, 1, 2, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(w, {1, 2, 1, 2}, {GTK_FILL, 0});
w.show();
dlgTexReset.editShiftVert = ui::Entry( 256 );
gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editShiftVert ), "0" );
- gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editShiftVert, 2, 3, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(dlgTexReset.editShiftVert, {2, 3, 1, 2}, {GTK_FILL, 0});
dlgTexReset.editShiftVert.show();
// ---- /frame ----
table = ui::Table( 1, 3, TRUE );
table.show();
frame.add(table);
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
+ gtk_table_set_row_spacings(table, 5);
+ gtk_table_set_col_spacings(table, 5);
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
// ---- frame ----
dlgTexReset.cbRotation = ui::CheckButton( "Enabled" );
dlgTexReset.cbRotation.show();
- gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbRotation, 0, 1, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(dlgTexReset.cbRotation, {0, 1, 0, 1}, {GTK_FILL, 0});
w = ui::Label( "New Rotation Value: " );
- gtk_table_attach( GTK_TABLE( table ), w, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(w, {1, 2, 0, 1}, {GTK_FILL, 0});
w.show();
dlgTexReset.editRotation = ui::Entry( 256 );
gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editRotation ), "0" );
- gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editRotation, 2, 3, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(dlgTexReset.editRotation, {2, 3, 0, 1}, {GTK_FILL, 0});
dlgTexReset.editRotation.show();
// ---- /frame ----
// ---- /vbox ----
- gtk_window_set_position( GTK_WINDOW( window ),GTK_WIN_POS_CENTER );
+ gtk_window_set_position( window, GTK_WIN_POS_CENTER );
window.show();
gtk_grab_add( window );
window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
- gtk_window_set_title( GTK_WINDOW( window ), "Train Thing" );
+ gtk_window_set_title( window, "Train Thing" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop );
auto table = ui::Table( 2, 3, TRUE );
table.show();
frame.add(table);
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
+ gtk_table_set_row_spacings(table, 5);
+ gtk_table_set_col_spacings(table, 5);
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
// ---- frame ----
w = ui::Label( "X: " );
- gtk_table_attach( GTK_TABLE( table ), w, 0, 1, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(w, {0, 1, 0, 1}, {GTK_FILL, 0});
w.show();
radiusX = ui::Entry( 256 );
gtk_entry_set_text( GTK_ENTRY( radiusX ), "100" );
- gtk_table_attach( GTK_TABLE( table ), radiusX, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(radiusX, {1, 2, 0, 1}, {GTK_FILL, 0});
radiusX.show();
w = ui::Label( "Y: " );
- gtk_table_attach( GTK_TABLE( table ), w, 0, 1, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(w, {0, 1, 1, 2}, {GTK_FILL, 0});
w.show();
radiusY = ui::Entry( 256 );
gtk_entry_set_text( GTK_ENTRY( radiusY ), "100" );
- gtk_table_attach( GTK_TABLE( table ), radiusY, 1, 2, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(radiusY, {1, 2, 1, 2}, {GTK_FILL, 0});
radiusY.show();
table = ui::Table( 2, 3, TRUE );
table.show();
frame.add(table);
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
+ gtk_table_set_row_spacings((table), 5);
+ gtk_table_set_col_spacings((table), 5);
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
// ---- frame ----
w = ui::Label( "Start: " );
- gtk_table_attach( GTK_TABLE( table ), w, 0, 1, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(w, {0, 1, 0, 1}, {GTK_FILL, 0});
w.show();
angleStart = ui::Entry( 256 );
gtk_entry_set_text( GTK_ENTRY( angleStart ), "0" );
- gtk_table_attach( GTK_TABLE( table ), angleStart, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(angleStart, {1, 2, 0, 1}, {GTK_FILL, 0});
angleStart.show();
w = ui::Label( "End: " );
- gtk_table_attach( GTK_TABLE( table ), w, 0, 1, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(w, {0, 1, 1, 2}, {GTK_FILL, 0});
w.show();
angleEnd = ui::Entry( 256 );
gtk_entry_set_text( GTK_ENTRY( angleEnd ), "90" );
- gtk_table_attach( GTK_TABLE( table ), angleEnd, 1, 2, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(angleEnd, {1, 2, 1, 2}, {GTK_FILL, 0});
angleEnd.show();
table = ui::Table( 2, 3, TRUE );
table.show();
frame.add(table);
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
+ gtk_table_set_row_spacings(table, 5);
+ gtk_table_set_col_spacings(table, 5);
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
// ---- frame ----
w = ui::Label( "Start: " );
- gtk_table_attach( GTK_TABLE( table ), w, 0, 1, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(w, {0, 1, 0, 1}, {GTK_FILL, 0});
w.show();
heightStart = ui::Entry( 256 );
gtk_entry_set_text( GTK_ENTRY( heightStart ), "0" );
- gtk_table_attach( GTK_TABLE( table ), heightStart, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(heightStart, {1, 2, 0, 1}, {GTK_FILL, 0});
heightStart.show();
w = ui::Label( "End: " );
- gtk_table_attach( GTK_TABLE( table ), w, 0, 1, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(w, {0, 1, 1, 2}, {GTK_FILL, 0});
w.show();
heightEnd = ui::Entry( 256 );
gtk_entry_set_text( GTK_ENTRY( heightEnd ), "0" );
- gtk_table_attach( GTK_TABLE( table ), heightEnd, 1, 2, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(heightEnd, {1, 2, 1, 2}, {GTK_FILL, 0});
heightEnd.show();
table = ui::Table( 2, 3, TRUE );
table.show();
frame.add(table);
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
+ gtk_table_set_row_spacings(table, 5);
+ gtk_table_set_col_spacings(table, 5);
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
// ---- frame ----
w = ui::Label( "Number: " );
- gtk_table_attach( GTK_TABLE( table ), w, 0, 1, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(w, {0, 1, 0, 1}, {GTK_FILL, 0});
w.show();
numPoints = ui::Entry( 256 );
gtk_entry_set_text( GTK_ENTRY( numPoints ), "0" );
- gtk_table_attach( GTK_TABLE( table ), numPoints, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(numPoints, {1, 2, 0, 1}, {GTK_FILL, 0});
numPoints.show();
- gtk_window_set_position( GTK_WINDOW( window ),GTK_WIN_POS_CENTER );
+ gtk_window_set_position( window, GTK_WIN_POS_CENTER );
window.show();
gtk_grab_add( window );
window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
- gtk_window_set_title( GTK_WINDOW( window ), "Make Chain" );
+ gtk_window_set_title( window, "Make Chain" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
hbox.pack_start( w, FALSE, FALSE, 0 );
w.show();
- w = ui::Widget(gtk_hseparator_new());
+ w = ui::Widget::from(gtk_hseparator_new());
vbox.pack_start( w, FALSE, FALSE, 0 );
w.show();
ret = eIDCANCEL;
- gtk_window_set_position( GTK_WINDOW( window ),GTK_WIN_POS_CENTER );
+ gtk_window_set_position( window, GTK_WIN_POS_CENTER );
window.show();
gtk_grab_add( window );