gtk_container_add( GTK_CONTAINER( vbox1 ), contents );
- GtkAlignment* alignment = GTK_ALIGNMENT( gtk_alignment_new( 0.5, 0.0, 0.0, 0.0 ) );
+ ui::Alignment alignment = ui::Alignment( 0.5, 0.0, 0.0, 0.0 );
gtk_widget_show( GTK_WIDGET( alignment ) );
gtk_box_pack_start( GTK_BOX( vbox1 ), GTK_WIDGET( alignment ), FALSE, FALSE, 0 );
#include "widget.h"
GtkWidget* create_padding( int width, int height ){
- GtkWidget* widget = gtk_alignment_new( 0.0, 0.0, 0.0, 0.0 );
+ ui::Alignment widget = ui::Alignment( 0.0, 0.0, 0.0, 0.0 );
gtk_widget_show( widget );
gtk_widget_set_size_request( widget, width, height );
return widget;
GtkVBox* vboxDummy = create_dialog_vbox( 0, 0 );
gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( vboxDummy ), FALSE, FALSE, 0 );
- GtkAlignment* alignment = GTK_ALIGNMENT( gtk_alignment_new( 0.5, 0.0, 0.0, 0.0 ) );
+ GtkAlignment* alignment = ui::Alignment( 0.5, 0.0, 0.0, 0.0 );
gtk_widget_show( GTK_WIDGET( alignment ) );
gtk_box_pack_start( GTK_BOX( vboxDummy ), GTK_WIDGET( alignment ), FALSE, FALSE, 0 );
return g_signal_connect(G_OBJECT(*this), "key-press-event", (GCallback) +func, &pass);
}
+ Alignment::Alignment(float xalign, float yalign, float xscale, float yscale)
+ : Alignment(GTK_ALIGNMENT(gtk_alignment_new(xalign, yalign, xscale, yscale)))
+ { }
+
Button::Button(const char *label) : Button(GTK_BUTTON(gtk_button_new_with_label(label)))
{ }
#include <string>
-using ui_typeinst = struct _GTypeInstance;
-using ui_widget = struct _GtkWidget;
-using ui_window = struct _GtkWindow;
+using ui_alignment = struct _GtkAlignment;
using ui_button = struct _GtkButton;
-using ui_menuitem = struct _GtkMenuItem;
-using ui_label = struct _GtkLabel;
-
using ui_evkey = struct _GdkEventKey;
-
+using ui_label = struct _GtkLabel;
+using ui_menuitem = struct _GtkMenuItem;
using ui_modal = struct ModalDialog;
+using ui_typeinst = struct _GTypeInstance;
+using ui_widget = struct _GtkWidget;
+using ui_window = struct _GtkWindow;
namespace ui {
Label(const char *label);
);
+ WIDGET(Alignment, ui_alignment,
+ Alignment(float xalign, float yalign, float xscale, float yscale);
+ );
+
}
#endif
};
DialogEntryRow DialogEntryRow_new( const char* name ){
- ui::Widget alignment = ui::Widget(gtk_alignment_new( 0.0, 0.5, 0.0, 0.0 ));
+ ui::Widget alignment = ui::Alignment( 0.0, 0.5, 0.0, 0.0 );
gtk_widget_show( alignment );
GtkEntry* entry = DialogEntry_new();
};
DialogSpinnerRow DialogSpinnerRow_new( const char* name, double value, double lower, double upper, int fraction ){
- ui::Widget alignment = ui::Widget(gtk_alignment_new( 0.0, 0.5, 0.0, 0.0 ));
+ ui::Widget alignment = ui::Alignment( 0.0, 0.5, 0.0, 0.0 );
gtk_widget_show( alignment );
GtkSpinButton* spin = DialogSpinner_new( value, lower, upper, fraction );
}
void Dialog::addCombo( ui::Widget vbox, const char* name, StringArrayRange values, const IntImportCallback& importViewer, const IntExportCallback& exportViewer ){
- ui::Widget alignment = ui::Widget(gtk_alignment_new( 0.0, 0.5, 0.0, 0.0 ));
+ ui::Widget alignment = ui::Alignment( 0.0, 0.5, 0.0, 0.0 );
gtk_widget_show( alignment );
{
ui::Widget combo = ui::Widget(gtk_combo_box_new_text());
AddIntAdjustmentData( *GTK_ADJUSTMENT( adj ), IntImportCaller( data ), IntExportCaller( data ) );
// scale
- ui::Widget alignment = ui::Widget(gtk_alignment_new( 0.0, 0.5, 1.0, 0.0 ));
+ ui::Widget alignment = ui::Alignment( 0.0, 0.5, 1.0, 0.0 );
gtk_widget_show( alignment );
ui::Widget scale = ui::Widget(gtk_hscale_new( GTK_ADJUSTMENT( adj ) ));
}
void Dialog::addRadio( ui::Widget vbox, const char* name, StringArrayRange names, const IntImportCallback& importViewer, const IntExportCallback& exportViewer ){
- ui::Widget alignment = ui::Widget(gtk_alignment_new( 0.0, 0.5, 0.0, 0.0 ));
+ ui::Widget alignment = ui::Alignment( 0.0, 0.5, 0.0, 0.0 );
gtk_widget_show( alignment );
{
RadioHBox radioBox = RadioHBox_new( names );