{
return tree_column->button;
}
-#define gtk_tree_view_column_get_button wx_gtk_tree_view_column_get_button
+#define gtk_tree_view_column_get_button wx_gtk_tree_view_column_get_button
+
+static inline GtkWidget* wx_gtk_box_new(GtkOrientation orientation, gint spacing)
+{
+ GtkWidget* widget;
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ widget = gtk_hbox_new(false, spacing);
+ else
+ widget = gtk_vbox_new(false, spacing);
+ return widget;
+}
+#define gtk_box_new wx_gtk_box_new
+
+static inline GtkWidget* wx_gtk_button_box_new(GtkOrientation orientation)
+{
+ GtkWidget* widget;
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ widget = gtk_hbutton_box_new();
+ else
+ widget = gtk_vbutton_box_new();
+ return widget;
+}
+#define gtk_button_box_new wx_gtk_button_box_new
+
+static inline GtkWidget* wx_gtk_scale_new(GtkOrientation orientation, GtkAdjustment* adjustment)
+{
+ GtkWidget* widget;
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ widget = gtk_hscale_new(adjustment);
+ else
+ widget = gtk_vscale_new(adjustment);
+ return widget;
+}
+#define gtk_scale_new wx_gtk_scale_new
+
+static inline GtkWidget* wx_gtk_scrollbar_new(GtkOrientation orientation, GtkAdjustment* adjustment)
+{
+ GtkWidget* widget;
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ widget = gtk_hscrollbar_new(adjustment);
+ else
+ widget = gtk_vscrollbar_new(adjustment);
+ return widget;
+}
+#define gtk_scrollbar_new wx_gtk_scrollbar_new
+
+static inline GtkWidget* wx_gtk_separator_new(GtkOrientation orientation)
+{
+ GtkWidget* widget;
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ widget = gtk_hseparator_new();
+ else
+ widget = gtk_vseparator_new();
+ return widget;
+}
+#define gtk_separator_new wx_gtk_separator_new
+
+static inline void wx_gtk_widget_get_preferred_height(GtkWidget* widget, gint* minimum, gint* natural)
+{
+ GtkRequisition req;
+ gtk_widget_size_request(widget, &req);
+ if (minimum)
+ *minimum = req.height;
+ if (natural)
+ *natural = req.height;
+}
+#define gtk_widget_get_preferred_height wx_gtk_widget_get_preferred_height
+
+static inline void wx_gtk_widget_get_preferred_width(GtkWidget* widget, gint* minimum, gint* natural)
+{
+ GtkRequisition req;
+ gtk_widget_size_request(widget, &req);
+ if (minimum)
+ *minimum = req.width;
+ if (natural)
+ *natural = req.width;
+}
+#define gtk_widget_get_preferred_width wx_gtk_widget_get_preferred_width
+
+static inline void wx_gtk_widget_get_preferred_size(GtkWidget* widget, GtkRequisition* minimum, GtkRequisition* natural)
+{
+ GtkRequisition* req = minimum;
+ if (req == NULL)
+ req = natural;
+ gtk_widget_size_request(widget, req);
+}
+#define gtk_widget_get_preferred_size wx_gtk_widget_get_preferred_size
#endif // !__WXGTK3__
#endif // _WX_GTK_PRIVATE_COMPAT_H_
#ifdef __WXGTK__
if (!show)
{
+#ifdef __WXGTK3__
+ GdkDisplay* display = gtk_widget_get_display(m_widget);
+ GdkDeviceManager* manager = gdk_display_get_device_manager(display);
+ GdkDevice* device = gdk_device_manager_get_client_pointer(manager);
+ gdk_device_ungrab(device, unsigned(GDK_CURRENT_TIME));
+#else
gdk_pointer_ungrab( (guint32)GDK_CURRENT_TIME );
+#endif
gtk_grab_remove( m_widget );
}
{
gtk_grab_add( m_widget );
- gdk_pointer_grab( gtk_widget_get_window(m_widget), true,
- (GdkEventMask)
- (GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_HINT_MASK |
- GDK_POINTER_MOTION_MASK),
+ const GdkEventMask mask = GdkEventMask(
+ GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK |
+ GDK_POINTER_MOTION_HINT_MASK |
+ GDK_POINTER_MOTION_MASK);
+ GdkWindow* window = gtk_widget_get_window(m_widget);
+#ifdef __WXGTK3__
+ GdkDisplay* display = gdk_window_get_display(window);
+ GdkDeviceManager* manager = gdk_display_get_device_manager(display);
+ GdkDevice* device = gdk_device_manager_get_client_pointer(manager);
+ gdk_device_grab(device, window,
+ GDK_OWNERSHIP_NONE, false, mask, NULL, unsigned(GDK_CURRENT_TIME));
+#else
+ gdk_pointer_grab( window, true,
+ mask,
NULL,
NULL,
(guint32)GDK_CURRENT_TIME );
+#endif
}
#endif
// with "stock-id" representation (in addition to pixmap and pixbuf
// ones) and would convert it to pixbuf when rendered.
- GtkStyle* style = gtk_widget_get_style(wxGTKPrivate::GetButtonWidget());
+ GtkWidget* widget = wxGTKPrivate::GetButtonWidget();
+#ifdef __WXGTK3__
+ GtkStyleContext* sc = gtk_widget_get_style_context(widget);
+ GtkIconSet* iconset = gtk_style_context_lookup_icon_set(sc, stockid);
+ GdkPixbuf* pixbuf = NULL;
+ if (iconset)
+ pixbuf = gtk_icon_set_render_icon_pixbuf(iconset, sc, size);
+ return pixbuf;
+#else
+ GtkStyle* style = gtk_widget_get_style(widget);
GtkIconSet* iconset = gtk_style_lookup_icon_set(style, stockid);
if (!iconset)
return gtk_icon_set_render_icon(iconset, style,
gtk_widget_get_default_direction(),
GTK_STATE_NORMAL, size, NULL, NULL);
+#endif
}
GdkPixbuf *CreateThemeIcon(const char *iconname, int size)
const wxString stockid = wxArtIDToStock(id);
// try to load the bundle as stock icon first
- GtkStyle* style = gtk_widget_get_style(wxGTKPrivate::GetButtonWidget());
+ GtkWidget* widget = wxGTKPrivate::GetButtonWidget();
+#ifdef __WXGTK3__
+ GtkStyleContext* sc = gtk_widget_get_style_context(widget);
+ GtkIconSet* iconset = gtk_style_context_lookup_icon_set(sc, stockid.utf8_str());
+#else
+ GtkStyle* style = gtk_widget_get_style(widget);
GtkIconSet* iconset = gtk_style_lookup_icon_set(style, stockid.utf8_str());
+#endif
if ( iconset )
{
GtkIconSize *sizes;
#define SOURCE_FILE_COLIDX 2
#define LINE_NUMBER_COLIDX 3
-
-
-
/* ----------------------------------------------------------------------------
GtkAssertDialog helpers
---------------------------------------------------------------------------- */
/* toggle busy cursor */
gdk_window_set_cursor (parent, NULL);
+#ifdef __WXGTK3__
+ g_object_unref(cur);
+#else
gdk_cursor_unref (cur);
+#endif
}
-
-
extern "C" {
/* ----------------------------------------------------------------------------
GtkAssertDialog signal handlers
static void gtk_assert_dialog_init (GtkAssertDialog *self);
static void gtk_assert_dialog_class_init (GtkAssertDialogClass *klass);
-
GType gtk_assert_dialog_get_type()
{
static GType assert_dialog_type;
/* start the main vbox */
gtk_widget_push_composite_child ();
- vbox = gtk_vbox_new (FALSE, 8);
+ vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 8);
gtk_container_set_border_width (GTK_CONTAINER(vbox), 8);
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dlg))), vbox, true, true, 5);
/* add the icon+message hbox */
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
/* icon */
GtkWidget *vbox2, *info;
/* message */
- vbox2 = gtk_vbox_new (FALSE, 0);
+ vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
info = gtk_label_new ("An assertion failed!");
gtk_box_pack_start (GTK_BOX(vbox2), info, TRUE, TRUE, 8);
GtkWidget *hbox, *vbox, *button, *sw;
/* create expander's vbox */
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (dlg->expander), vbox);
/* add a scrollable window under the expander */
gtk_container_add (GTK_CONTAINER (sw), dlg->treeview);
/* create button's hbox */
- hbox = gtk_hbutton_box_new ();
+ hbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_end (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
gtk_button_box_set_layout (GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_END);
gtk_widget_show_all (GTK_WIDGET(dlg));
}
-
-
/* ----------------------------------------------------------------------------
GtkAssertDialog public API
---------------------------------------------------------------------------- */
// button's size. We have to retrieve both values and combine them.
GtkWidget *wnd = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- GtkWidget *box = gtk_hbutton_box_new();
+ GtkWidget *box = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
GtkWidget *btn = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
gtk_container_add(GTK_CONTAINER(box), btn);
gtk_container_add(GTK_CONTAINER(wnd), box);
GtkRequisition req;
-#ifdef __WXGTK3__
- gtk_widget_get_preferred_height(btn, NULL, &req.height);
- gtk_widget_get_preferred_width_for_height(btn, req.height, NULL, &req.width);
-#else
- gtk_widget_size_request(btn, &req);
-#endif
+ gtk_widget_get_preferred_size(btn, NULL, &req);
gint minwidth, minheight;
gtk_widget_style_get(box,
m_widgetLabel = gtk_label_new("");
gtk_misc_set_alignment(GTK_MISC(m_widgetLabel), 0.0, 0.5);
- m_widget = gtk_hbox_new(FALSE, 0);
+ m_widget = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start(GTK_BOX(m_widget), m_widgetLabel, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(m_widget), m_widgetCheckbox, FALSE, FALSE, 3);
return intval;
}
-
void wxChoice::GTKDisableEvents()
{
g_signal_handlers_block_by_func(m_widget,
(gpointer) gtk_choice_changed_callback, this);
}
-
GdkWindow *wxChoice::GTKGetWindow(wxArrayGdkWindows& WXUNUSED(windows)) const
{
return gtk_widget_get_window(m_widget);
// We are interested in the difference of sizes between the whole contol
// and its child part. I.e. arrow, separators, etc.
GtkRequisition req;
- gtk_widget_size_request(childPart, &req);
+ gtk_widget_get_preferred_size(childPart, NULL, &req);
wxSize totalS = GTKGetPreferredSize(m_widget);
wxSize tsize(xlen + totalS.x - req.width, totalS.y);
GTKApplyStyle(gtk_bin_get_child(GTK_BIN(m_widget)), style);
}
-
// static
wxVisualAttributes
wxChoice::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
return GetDefaultAttributesFromGTKWidget(gtk_combo_box_new());
}
-
#endif // wxUSE_CHOICE || wxUSE_COMBOBOX
GtkRequisition req;
#ifdef __WXGTK3__
- gtk_widget_get_preferred_width(m_widget, NULL, &req.width);
- gtk_widget_get_preferred_height_for_width(m_widget, req.width, NULL, &req.height);
+ gtk_widget_get_preferred_size(m_widget, NULL, &req);
#else
GTK_WIDGET_GET_CLASS(m_widget)->size_request(m_widget, &req);
#endif
{
GtkRequisition req;
#ifdef __WXGTK3__
- if (gtk_widget_get_request_mode(widget) != GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH)
- {
- gtk_widget_get_preferred_height(widget, NULL, &req.height);
- gtk_widget_get_preferred_width_for_height(widget, req.height, NULL, &req.width);
- }
- else
- {
- gtk_widget_get_preferred_width(widget, NULL, &req.width);
- gtk_widget_get_preferred_height_for_width(widget, req.width, NULL, &req.height);
- }
+ gtk_widget_get_preferred_size(widget, NULL, &req);
#else
GTK_WIDGET_GET_CLASS(widget)->size_request(widget, &req);
#endif
GTK_TREE_MODEL(wxgtk_model), &iter ));
GdkRectangle cell_area;
gtk_tree_view_get_cell_area( widget, path, gcolumn, &cell_area );
-
+#ifdef __WXGTK3__
+ GtkAdjustment* hadjust = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE(widget));
+#else
GtkAdjustment* hadjust = gtk_tree_view_get_hadjustment( widget );
+#endif
double d = gtk_adjustment_get_value( hadjust );
int xdiff = (int) d;
SetWidth( width );
// Create container for icon and label
- GtkWidget *box = gtk_hbox_new( FALSE, 1 );
+ GtkWidget* box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1);
gtk_widget_show( box );
// gtk_container_set_border_width((GtkContainer*)box, 2);
m_image = gtk_image_new();
wxWindow *child = node->GetData();
GtkRequisition req;
- gtk_widget_size_request( child->m_widget, &req );
+ gtk_widget_get_preferred_size(child->m_widget, NULL, &req);
GtkAllocation alloc;
alloc.x = child->m_x;
GdkEventMotion *gdk_event,
wxDataViewCtrl *dv )
{
+ int x = gdk_event->x;
+ int y = gdk_event->y;
if (gdk_event->is_hint)
{
- int x = 0;
- int y = 0;
- GdkModifierType state;
- gdk_window_get_pointer(gdk_event->window, &x, &y, &state);
- gdk_event->x = x;
- gdk_event->y = y;
+#ifdef __WXGTK3__
+ gdk_window_get_device_position(gdk_event->window, gdk_event->device, &x, &y, NULL);
+#else
+ gdk_window_get_pointer(gdk_event->window, &x, &y, NULL);
+#endif
}
wxGtkTreePath path;
gint cell_y = 0;
if (gtk_tree_view_get_path_at_pos(
GTK_TREE_VIEW(dv->GtkGetTreeView()),
- (int) gdk_event->x, (int) gdk_event->y,
+ x, y,
path.ByRef(),
&column,
&cell_x,
#endif // WX_PRECOMP
#include <gtk/gtk.h>
+#include "wx/gtk/private/gtk2-compat.h"
#if wxUSE_LIBHILDON
#include <hildon-widgets/hildon-window.h>
// menu bar
if (m_frameMenuBar && m_frameMenuBar->IsShown())
{
- GtkRequisition req;
- gtk_widget_size_request(m_frameMenuBar->m_widget, &req);
+ int h;
+ gtk_widget_get_preferred_height(m_frameMenuBar->m_widget, NULL, &h);
#if !wxUSE_LIBHILDON && !wxUSE_LIBHILDON2
- *height -= req.height;
+ *height -= h;
#endif
}
#endif // wxUSE_MENUS_NATIVE
// tool bar
if (m_frameToolBar && m_frameToolBar->IsShown())
{
- GtkRequisition req;
- gtk_widget_size_request(m_frameToolBar->m_widget, &req);
if (m_frameToolBar->IsVertical())
{
if (width)
- *width -= req.width;
+ {
+ int w;
+ gtk_widget_get_preferred_width(m_frameToolBar->m_widget, NULL, &w);
+ *width -= w;
+ }
}
else
{
if (height)
- *height -= req.height;
+ {
+ int h;
+ gtk_widget_get_preferred_height(m_frameToolBar->m_widget, NULL, &h);
+ *height -= h;
+ }
}
}
#endif // wxUSE_TOOLBAR
// Vertical toolbar and m_wxwindow go into an hbox, inside the
// vbox (m_mainWidget). hbox is created on demand.
GtkWidget* hbox = gtk_widget_get_parent(m_wxwindow);
- if (!GTK_IS_HBOX(hbox))
+ if (hbox == m_mainWidget)
{
- hbox = gtk_hbox_new(false, 0);
+ hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show(hbox);
- gtk_container_add(GTK_CONTAINER(m_mainWidget), hbox);
+ gtk_box_pack_start(GTK_BOX(m_mainWidget), hbox, true, true, 0);
gtk_widget_reparent(m_wxwindow, hbox);
}
gtk_widget_reparent(toolbar->m_widget, hbox);
#include "wx/gtk/treeentry_gtk.h"
#include <gdk/gdkkeysyms.h>
-#if GTK_CHECK_VERSION(3,0,0)
+#ifdef __WXGTK3__
#include <gdk/gdkkeysyms-compat.h>
#endif
wxCHECK_RET( IsValid(n), wxT("invalid index"));
//RN: I have no idea why this line is needed...
- if (gdk_pointer_is_grabbed () && gtk_widget_has_grab(GTK_WIDGET(m_treeview)))
+ if (gtk_widget_has_grab(GTK_WIDGET(m_treeview)))
return;
GtkTreeIter iter;
if (menubar && menubar->IsShown())
{
GtkRequisition req;
- gtk_widget_size_request(menubar->m_widget, &req);
+ gtk_widget_get_preferred_height(menubar->m_widget, NULL, &req.height);
*height -= req.height;
if (*height < 0) *height = 0;
}
for ( size_t n = 0; n < pageCount; n++ )
{
GtkRequisition req;
- gtk_widget_size_request(GetNotebookPage(n)->m_box, &req);
+ gtk_widget_get_preferred_size(GetNotebookPage(n)->m_box, NULL, &req);
sizeTabMax.IncTo(wxSize(req.width, req.height));
}
// first page.
pageData->m_imageIndex = imageId;
- pageData->m_box = gtk_hbox_new(false, 1);
+ pageData->m_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1);
gtk_container_set_border_width(GTK_CONTAINER(pageData->m_box), 2);
pageData->m_image = NULL;
const size_t count = GetPageCount();
size_t i = 0;
-#if !GTK_CHECK_VERSION(3,0,0) && !defined(GSEAL_ENABLE)
+#ifndef __WXGTK3__
GtkNotebook * notebook = GTK_NOTEBOOK(m_widget);
if (gtk_notebook_get_scrollable(notebook))
i = g_list_position( notebook->children, notebook->first_tab );
}
const bool isVertical = (style & wxSB_VERTICAL) != 0;
- if (isVertical)
- m_widget = gtk_vscrollbar_new( NULL );
- else
- m_widget = gtk_hscrollbar_new( NULL );
+ m_widget = gtk_scrollbar_new(GtkOrientation(isVertical), NULL);
g_object_ref(m_widget);
m_scrollBar[0] = (GtkRange*)m_widget;
wxVisualAttributes
wxScrollBar::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
{
- return GetDefaultAttributesFromGTKWidget(gtk_vscrollbar_new(NULL));
+ return GetDefaultAttributesFromGTKWidget(gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, NULL));
}
#endif // wxUSE_SCROLLBAR
return false;
}
-
- if (style & wxSL_VERTICAL)
- m_scale = gtk_vscale_new( NULL );
- else
- m_scale = gtk_hscale_new( NULL );
+ const bool isVertical = (style & wxSL_VERTICAL) != 0;
+ m_scale = gtk_scale_new(GtkOrientation(isVertical), NULL);
if (style & wxSL_MIN_MAX_LABELS)
{
gtk_widget_show( m_scale );
- if (style & wxSL_VERTICAL)
- m_widget = gtk_hbox_new(false, 0);
- else
- m_widget = gtk_vbox_new(false, 0);
- gtk_container_add( GTK_CONTAINER(m_widget), m_scale );
+ m_widget = gtk_box_new(GtkOrientation(!isVertical), 0);
+ gtk_box_pack_start(GTK_BOX(m_widget), m_scale, true, true, 0);
- GtkWidget *box;
- if (style & wxSL_VERTICAL)
- box = gtk_vbox_new(false,0);
- else
- box = gtk_hbox_new(false,0);
+ GtkWidget* box = gtk_box_new(GtkOrientation(isVertical), 0);
gtk_widget_show(box);
- gtk_container_add( GTK_CONTAINER(m_widget), box );
+ gtk_box_pack_start(GTK_BOX(m_widget), box, true, true, 0);
m_minLabel = gtk_label_new(NULL);
gtk_widget_show( m_minLabel );
- gtk_container_add( GTK_CONTAINER(box), m_minLabel );
- gtk_box_set_child_packing( GTK_BOX(box), m_minLabel, FALSE, FALSE, 0, GTK_PACK_START );
+ gtk_box_pack_start(GTK_BOX(box), m_minLabel, false, false, 0);
// expanding empty space between the min/max labels
GtkWidget *space = gtk_label_new(NULL);
gtk_widget_show( space );
- gtk_container_add( GTK_CONTAINER(box), space );
- gtk_box_set_child_packing( GTK_BOX(box), space, TRUE, FALSE, 0, GTK_PACK_START );
+ gtk_box_pack_start(GTK_BOX(box), space, true, false, 0);
m_maxLabel = gtk_label_new(NULL);
gtk_widget_show( m_maxLabel );
- gtk_container_add( GTK_CONTAINER(box), m_maxLabel );
- gtk_box_set_child_packing( GTK_BOX(box), m_maxLabel, FALSE, FALSE, 0, GTK_PACK_END );
+ gtk_box_pack_end(GTK_BOX(box), m_maxLabel, false, false, 0);
}
else
{
wxVisualAttributes
wxSlider::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
{
- return GetDefaultAttributesFromGTKWidget(gtk_vscale_new(NULL));
+ return GetDefaultAttributesFromGTKWidget(gtk_scale_new(GTK_ORIENTATION_VERTICAL, NULL));
}
#endif // wxUSE_SLIDER
#if wxUSE_STATLINE
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
+#include <gtk/gtk.h>
+#include "wx/gtk/private/gtk2-compat.h"
//-----------------------------------------------------------------------------
// wxStaticLine
return FALSE;
}
- if ( IsVertical() )
+ const bool isVertical = IsVertical();
+ m_widget = gtk_separator_new(GtkOrientation(isVertical));
+ g_object_ref(m_widget);
+ if (isVertical)
{
- m_widget = gtk_vseparator_new();
if (size.x == -1)
{
wxSize new_size( size );
}
else
{
- m_widget = gtk_hseparator_new();
if (size.y == -1)
{
wxSize new_size( size );
SetSize( new_size );
}
}
- g_object_ref(m_widget);
m_parent->DoAddChild( this );
wxVisualAttributes
wxStaticLine::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
{
- return GetDefaultAttributesFromGTKWidget(gtk_vseparator_new());
+ return GetDefaultAttributesFromGTKWidget(gtk_separator_new(GTK_ORIENTATION_VERTICAL));
}
#endif
void wxToolBarTool::CreateDropDown()
{
gtk_tool_item_set_homogeneous(m_item, false);
- GtkWidget* box;
- GtkWidget* arrow;
+ GtkOrientation orient = GTK_ORIENTATION_HORIZONTAL;
+ GtkArrowType arrowType = GTK_ARROW_DOWN;
if (GetToolBar()->HasFlag(wxTB_LEFT | wxTB_RIGHT))
{
- box = gtk_vbox_new(false, 0);
- arrow = gtk_arrow_new(GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
- }
- else
- {
- box = gtk_hbox_new(false, 0);
- arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE);
+ orient = GTK_ORIENTATION_VERTICAL;
+ arrowType = GTK_ARROW_RIGHT;
}
+ GtkWidget* box = gtk_box_new(orient, 0);
+ GtkWidget* arrow = gtk_arrow_new(arrowType, GTK_SHADOW_NONE);
GtkWidget* tool_button = gtk_bin_get_child(GTK_BIN(m_item));
gtk_widget_reparent(tool_button, box);
GtkWidget* arrow_button = gtk_toggle_button_new();
G_CALLBACK (gtk_frame_delete_callback), this);
// m_mainWidget is a GtkVBox, holding the bars and client area (m_wxwindow)
- m_mainWidget = gtk_vbox_new(false, 0);
+ m_mainWidget = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show( m_mainWidget );
gtk_widget_set_can_focus(m_mainWidget, false);
gtk_container_add( GTK_CONTAINER(m_widget), m_mainWidget );
// m_wxwindow is the client area
m_wxwindow = wxPizza::New();
gtk_widget_show( m_wxwindow );
- gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow );
+ gtk_box_pack_start(GTK_BOX(m_mainWidget), m_wxwindow, true, true, 0);
// we donm't allow the frame to get the focus as otherwise
// the frame will grab it at arbitrary focus changes