===== Organization: Thought Unlimited. Public service Unix since 1986. Of_Interest: With 28 years of service to the Unix community.
On Wed, Sep 03, 2014 at 10:44:55PM +0200, Marcus Karlsson wrote: > On Wed, Sep 03, 2014 at 01:13:06PM -0700, Gary Kline wrote: > > thanks for your input, marcus, but could you give me a few lines of > > code? I tried using the gtk_label_set_text() for over an hour > > last night until it felt like my shoulder was going to drop off and > > fall on the floor! > > You should be able to set the text with something like: > > gtk_label_set_text (GTK_LABEL (label), "some text"); > > But this requires that you have a valid pointer to your label, eiter in > a global variable or passed to the signal handler as the user_data > pointer. > > > other than usinng "g_signal_connect()" to bail out with a Quit, > > the only times I see anything to do with a signal are after going > > GTK_ARROW_UP or _DOWN.... I may have misplaced the > > gtk_label_get_text() stuff. > > > > iv'e got: > > > > gtk_label_get_text(GTK_LABEL(user_data), buf ); > > > > which now looks aways off... need more clues. > > Gtk_label_get_text () returns the string in the return value, so you > need to to something like: > > str = gtk_label_get_text (GTK_LABEL (user_data)); > > This of course also requires that the user_data pointer is pointing at a > label. In your code sample you passed 0 and 1 as the pointers, which > most likely will not be valid pointers to your labels. > > It's often a good idea to group the elements that you need to access > into an object and pass it as the user_data pointer. A struct would be > sufficient. This could also include a field which says which label is > currently selected, for example using and int in the range of 1 to 3. > > If you want to reuse the signal handler and still distinguish which > button caused the signal then you can use the currently unused first > argument which should point to the sender of the signal, or the button > which was pressed down. > > Marcus well, here's the dope: after my 27th cup of french roast, it's all coming together. *Or*, with a few more hacks, most things will fit. still, no one has been able to answer my main question: how, using the arrow keys, do I attach onto the individual labels? I print 3 labels to demonstrate what will appear of the window. there probably will be dozens of strings that will become labels. I need the up/down arrow keys to select One label. Another part of the program will speak that string. your code examples were helpful. my main snafu was in mixing up the "GTK_MACROS". The main step is getting the arrow keys to incicatte--probably with a horizontal line--the right label. gary -- Gary Kline kl...@thought.org http://www.thought.org Public Service Unix Twenty-eight years of service to the Unix community. _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list