(Easy?) Newbie enquiry re: pointers
- From: kakuta Safe-mail net
- To: gtk-app-devel-list gnome org
- Subject: (Easy?) Newbie enquiry re: pointers
- Date: Tue, 10 Oct 2006 13:47:20 -0400
I am currently attempting to write my first GTK program, which is
a graphical mp3 jukebox frontend to the mpg123 linux command.
I wish to have each button on a grid correspond to a different mp3 track. To do this I pass a pointer to a
string (the name of the mp3 file) to the respective button callback functions. This all works
well - the problem is that I have also built a 'reload button'
which refreshes all the strings so that the same button then plays a
different track to before the reload.
The problem is that
even though the strings the pointers point to do seem to change
(I write them out on leaving gtk_main) the buttons still seem to point to
the orignal strings, even though they have been overwirtten.
Thus the button seems locked on to the original mp3 filename
even if I overwrite this string.
I guess this problem is perhaps easily overcome? (I can supply whatever details you may require including the
code itself).
Many thanks,
Dan.
p.s. I am new to GUI programming so please keep the advice at 'idiot level'!
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]