wxMenuItem *mitem = new wxMenuItem();
mitem->SetId(ID_SEPARATOR);
+#if (GTK_MINOR_VERSION > 0)
+ GtkItemFactoryEntry entry;
+ entry.path = "/sep";
+ entry.callback = (GtkItemFactoryCallback) NULL;
+ entry.callback_action = 0;
+ entry.item_type = "<Separator>";
+ entry.accelerator = (gchar*) NULL;
+
+ gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
+
+ /* this will be wrong for more than one separator. do we care? */
+ GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, "<main>/sep" );
+#else
GtkWidget *menuItem = gtk_menu_item_new();
gtk_menu_append( GTK_MENU(m_menu), menuItem );
gtk_widget_show( menuItem );
+#endif
mitem->SetMenuItem(menuItem);
m_items.Append( mitem );
}
else
{
- int old_width = m_width;
- int old_height = m_height;
-
if ((sizeFlags & wxSIZE_USE_EXISTING) == wxSIZE_USE_EXISTING)
{
if (x != -1) m_x = x;
wxMenuItem *mitem = new wxMenuItem();
mitem->SetId(ID_SEPARATOR);
+#if (GTK_MINOR_VERSION > 0)
+ GtkItemFactoryEntry entry;
+ entry.path = "/sep";
+ entry.callback = (GtkItemFactoryCallback) NULL;
+ entry.callback_action = 0;
+ entry.item_type = "<Separator>";
+ entry.accelerator = (gchar*) NULL;
+
+ gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
+
+ /* this will be wrong for more than one separator. do we care? */
+ GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, "<main>/sep" );
+#else
GtkWidget *menuItem = gtk_menu_item_new();
gtk_menu_append( GTK_MENU(m_menu), menuItem );
gtk_widget_show( menuItem );
+#endif
mitem->SetMenuItem(menuItem);
m_items.Append( mitem );
}
else
{
- int old_width = m_width;
- int old_height = m_height;
-
if ((sizeFlags & wxSIZE_USE_EXISTING) == wxSIZE_USE_EXISTING)
{
if (x != -1) m_x = x;
GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
GTK_WIDGET_SET_FLAGS( m_glWidget, GTK_CAN_FOCUS );
- gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), m_glWidget, 0, 0 );
+ gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), m_glWidget, 0, 0, m_width, m_height );
gtk_signal_connect( GTK_OBJECT(m_glWidget), "expose_event",
GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this );
if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
- gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x, m_y );
-
- if ((old_width != m_width) || (old_height != m_height))
- {
- gtk_widget_set_usize( m_widget, m_width, m_height );
-
- gtk_widget_set_usize( m_glWidget, m_width, m_height );
-
- GtkAllocation allo;
- allo.x = 0;
- allo.y = 0;
- allo.width = m_width;
- allo.height = m_height;
- gtk_widget_size_allocate( m_glWidget, &allo );
-
- }
+ gtk_myfixed_set_size( GTK_MYFIXED(m_parent->m_wxwindow),
+ m_widget,
+ m_x,
+ m_y,
+ m_width,
+ m_height );
+
+ gtk_myfixed_set_size( GTK_MYFIXED(m_wxwindow),
+ m_glWidget,
+ m_x,
+ m_y,
+ m_width,
+ m_height );
}
m_sizeSet = TRUE;