update GtkWidget allocation access method
This commit is contained in:
parent
d214be3911
commit
50e1af1a16
|
|
@ -101,7 +101,9 @@ void ShowPreview(){
|
|||
}
|
||||
|
||||
static void draw_preview(){
|
||||
int width = g_pPreviewWidget->allocation.width, height = g_pPreviewWidget->allocation.height;
|
||||
GtkAllocation allocation;
|
||||
gtk_widget_get_allocation( g_pPreviewWidget, &allocation );
|
||||
int width = allocation.width, height = allocation.height;
|
||||
|
||||
g_GLTable.m_pfn_qglClearColor( 0, 0, 0, 1 );
|
||||
g_GLTable.m_pfn_qglViewport( 0, 0, width, height );
|
||||
|
|
@ -181,7 +183,9 @@ static gint expose( GtkWidget *widget, GdkEventExpose *event, gpointer data ){
|
|||
}
|
||||
|
||||
static void button_press( GtkWidget *widget, GdkEventButton *event, gpointer data ){
|
||||
Point pt = { (long)event->x, widget->allocation.height - (long)event->y };
|
||||
GtkAllocation allocation;
|
||||
gtk_widget_get_allocation( widget, &allocation );
|
||||
Point pt = { (long)event->x, allocation.height - (long)event->y };
|
||||
bool Selected;
|
||||
double x,y;
|
||||
int i, j, k, ks;
|
||||
|
|
@ -290,7 +294,9 @@ static void button_press( GtkWidget *widget, GdkEventButton *event, gpointer dat
|
|||
}
|
||||
|
||||
static void motion( GtkWidget *widget, GdkEventMotion *event, gpointer data ){
|
||||
Point pt = { (long)event->x, widget->allocation.height - (long)event->y };
|
||||
GtkAllocation allocation;
|
||||
gtk_widget_get_allocation( widget, &allocation );
|
||||
Point pt = { (long)event->x, allocation.height - (long)event->y };
|
||||
|
||||
if ( !VertexMode ) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -193,8 +193,10 @@ void freeze_pointer( GtkWindow* window, GtkWidget* widget, MotionDeltaFunction f
|
|||
|
||||
/* using center for tracking for max safety */
|
||||
gdk_window_get_origin( gtk_widget_get_window( widget ), ¢er_x, ¢er_y );
|
||||
center_y += widget->allocation.height / 2;
|
||||
center_x += widget->allocation.width / 2;
|
||||
GtkAllocation allocation;
|
||||
gtk_widget_get_allocation( widget, &allocation );
|
||||
center_y += allocation.height / 2;
|
||||
center_x += allocation.width / 2;
|
||||
|
||||
Sys_SetCursorPos( window, center_x, center_y );
|
||||
|
||||
|
|
|
|||
|
|
@ -588,8 +588,10 @@ static gint expose( GtkWidget *widget, GdkEventExpose *event, gpointer data ){
|
|||
}
|
||||
|
||||
if ( g_bTexViewReady ) {
|
||||
g_2DView.m_rect.bottom = widget->allocation.height;
|
||||
g_2DView.m_rect.right = widget->allocation.width;
|
||||
GtkAllocation allocation;
|
||||
gtk_widget_get_allocation( widget, &allocation );
|
||||
g_2DView.m_rect.bottom = allocation.height;
|
||||
g_2DView.m_rect.right = allocation.width;
|
||||
|
||||
if ( !g_QglTable.m_pfn_glwidget_make_current( g_pToolWidget ) ) {
|
||||
Sys_Printf( "TexTool: glMakeCurrent failed\n" );
|
||||
|
|
|
|||
|
|
@ -1216,7 +1216,9 @@ gboolean disable_freelook_button_release( GtkWidget* widget, GdkEventButton* eve
|
|||
#if 0
|
||||
gboolean mousecontrol_button_press( GtkWidget* widget, GdkEventButton* event, CamWnd* camwnd ){
|
||||
if ( event->type == GDK_BUTTON_PRESS && event->button == 3 ) {
|
||||
Cam_MouseControl( camwnd->getCamera(), event->x, widget->allocation.height - 1 - event->y );
|
||||
GtkAllocation allocation;
|
||||
gtk_widget_get_allocation( widget, &allocation );
|
||||
Cam_MouseControl( camwnd->getCamera(), event->x, allocation.height - 1 - event->y );
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1266,7 +1268,9 @@ void selection_motion( gdouble x, gdouble y, guint state, void* data ){
|
|||
}
|
||||
|
||||
inline WindowVector windowvector_for_widget_centre( GtkWidget* widget ){
|
||||
return WindowVector( static_cast<float>( widget->allocation.width / 2 ), static_cast<float>( widget->allocation.height / 2 ) );
|
||||
GtkAllocation allocation;
|
||||
gtk_widget_get_allocation( widget, &allocation );
|
||||
return WindowVector( static_cast<float>( allocation.width / 2 ), static_cast<float>( allocation.height / 2 ) );
|
||||
}
|
||||
|
||||
gboolean selection_button_press_freemove( GtkWidget* widget, GdkEventButton* event, WindowObserver* observer ){
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user