// create the main frame window
DnDFrame *frame = new DnDFrame((wxFrame *) NULL,
"Drag-and-Drop/Clipboard wxWindows Sample",
- 50, 50, 450, 340);
+ 10, 10, 450, 340);
// activate it
frame->Show(TRUE);
/* I haven't been able to set the position of
the dialog before it is shown, so I set the
position in "realize" */
- gtk_widget_set_uposition( widget, win->m_x, win->m_y );
+ gtk_window_reposition( GTK_WINDOW(widget), win->m_x, win->m_y );
/* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */
{
/* we set the position here and when showing the dialog
for the first time in idle time */
- gtk_widget_set_uposition( m_widget, m_x, m_y );
+ gtk_window_reposition( GTK_WINDOW(m_widget), m_x, m_y );
}
}
if (!ret)
{
- wxLogDebug( wxT( "Drop target: OnDrop returned TRUE") );
+ wxLogDebug( wxT( "Drop target: OnDrop returned FALSE") );
/* cancel the whole thing */
gtk_drag_finish( context,
so we do this directly after realization */
static gint
-gtk_frame_realized_callback( GtkWidget *WXUNUSED(widget), wxFrame *win )
+gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
{
if (g_isIdle)
wxapp_install_idle_handler();
+ /* I haven't been able to set the position of
+ the dialog before it is shown, so I set the
+ position in "realize" */
+ printf( "%d %d\n", win->m_x, win->m_y );
+ gtk_window_reposition( GTK_WINDOW(widget), win->m_x, win->m_y );
+
/* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */
long decor = (long) GDK_DECOR_BORDER;
m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame;
- GtkWindowType win_type = GTK_WINDOW_TOPLEVEL;
+ GtkWindowType win_type = GTK_WINDOW_DIALOG; // this makes window placement work
if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP;
m_widget = gtk_window_new( win_type );
{
if ((m_x != old_x) || (m_y != old_y))
{
- gtk_widget_set_uposition( m_widget, m_x, m_y );
+ gtk_window_reposition( GTK_WINDOW(m_widget), m_x, m_y );
}
}
/* I haven't been able to set the position of
the dialog before it is shown, so I set the
position in "realize" */
- gtk_widget_set_uposition( widget, win->m_x, win->m_y );
+ gtk_window_reposition( GTK_WINDOW(widget), win->m_x, win->m_y );
/* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */
{
/* we set the position here and when showing the dialog
for the first time in idle time */
- gtk_widget_set_uposition( m_widget, m_x, m_y );
+ gtk_window_reposition( GTK_WINDOW(m_widget), m_x, m_y );
}
}
if (!ret)
{
- wxLogDebug( wxT( "Drop target: OnDrop returned TRUE") );
+ wxLogDebug( wxT( "Drop target: OnDrop returned FALSE") );
/* cancel the whole thing */
gtk_drag_finish( context,
so we do this directly after realization */
static gint
-gtk_frame_realized_callback( GtkWidget *WXUNUSED(widget), wxFrame *win )
+gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
{
if (g_isIdle)
wxapp_install_idle_handler();
+ /* I haven't been able to set the position of
+ the dialog before it is shown, so I set the
+ position in "realize" */
+ printf( "%d %d\n", win->m_x, win->m_y );
+ gtk_window_reposition( GTK_WINDOW(widget), win->m_x, win->m_y );
+
/* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */
long decor = (long) GDK_DECOR_BORDER;
m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame;
- GtkWindowType win_type = GTK_WINDOW_TOPLEVEL;
+ GtkWindowType win_type = GTK_WINDOW_DIALOG; // this makes window placement work
if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP;
m_widget = gtk_window_new( win_type );
{
if ((m_x != old_x) || (m_y != old_y))
{
- gtk_widget_set_uposition( m_widget, m_x, m_y );
+ gtk_window_reposition( GTK_WINDOW(m_widget), m_x, m_y );
}
}