[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Who can help?
- From: hack altavista net
- To: gtk-app-devel-list redhat com
- Subject: Who can help?
- Date: Wed, 11 Nov 1998 05:03:52 -0500 (EST)
Hi folks,
Thanks for trying to help me with my last question... but things are still working out wrong.
-- 8< snip --
//***************************************************************************//
// PixmapButton //
//***************************************************************************//
void PixmapButton (int ibutton)
{ /* PixmapButton */
char pixmapname[14];
sprintf (pixmapname, "./xpm/%s.xpm", Board[ibutton]);
button[ibutton] = gtk_event_box_new ();
gtk_widget_set_usize (button[ibutton], 30, 30);
gtk_table_attach (GTK_TABLE (table2), button[ibutton], x, (x + 1), y, (y + 1),
GTK_FILL, GTK_FILL, 0, 0);
gtk_signal_connect (GTK_OBJECT (button[ibutton]), "button_press_event",
GTK_SIGNAL_FUNC (MakeMove), (gpointer) ibutton);
gtk_widget_show (button[ibutton]);
style[ibutton] = gtk_widget_get_style (button[ibutton]);
pixmap[ibutton] = gdk_pixmap_create_from_xpm
(window1->window, &mask[ibutton], &style[ibutton]->bg[GTK_STATE_NORMAL],
pixmapname);
pixmapwid[ibutton] = gtk_pixmap_new (pixmap[ibutton], mask[ibutton]);
gtk_container_add (GTK_CONTAINER (button[ibutton]), pixmapwid[ibutton]);
gtk_widget_show (pixmapwid[ibutton]);
x++;
if (x == 19)
{
x = 0;
y++;
}
} /* PixmapButton */
//***************************************************************************//
// MakeMove //
//***************************************************************************//
void MakeMove (GtkWidget *widget, gpointer data)
{ /* MakeMove */
int ibutton;
ibutton = GPOINTER_TO_INT (data);
ChangePixmap (ibutton);
} /* MakeMove */
-- 8< snip --
The problem is that ibutton in 'ChangePixmap (ibutton);' in MakeMove is still waaaay larger than the ibutton passed through in the 'gtk_signal_connect (GTK_OBJECT (button[ibutton]), "button_press_event", GTK_SIGNAL_FUNC (MakeMove), (gpointer) ibutton);' in PixmapButton.
Why is this ibutton variable not passed correctly?
Can someone help me with this... thanks in advance.
Greetings, Norbert de Jonge
(hack@altavista.net)
----------------------------------------------------------------
Get your free email from AltaVista at http://altavista.iname.com
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]