Re: more of a C question than GTK+3.0??
- From: Gary Kline <kline thought org>
- To: Gergely Polonkai <gergely polonkai eu>
- Cc: gtk-app <gtk-app-devel-list gnome org>
- Subject: Re: more of a C question than GTK+3.0??
- Date: Sat, 6 Sep 2014 00:32:07 -0700
=====
Organization: Thought Unlimited.  Public service Unix since 1986.
Of_Interest: With 28 years  of service  to the  Unix  community.
On Sat, Sep 06, 2014 at 08:08:34AM +0200, Gergely Polonkai wrote:
On 6 Sep 2014 03:12, "Gary Kline" <kline thought org> wrote:
=====
Organization: Thought Unlimited.  Public service Unix since 1986.
Of_Interest: With 28 years  of service  to the  Unix  community.
        things that I *thought* might work by using
s = gtk_label_get_text(GTK_LABEL((GtkWidget)buf));
        fails.  (with contains the String "label1")  I have a index,
        "n" that can range from 1 to 99--whatever GtkWidget *label I
        need.  the next thing that occured was some kind of
        typedef struct
        {
                GtkWidget  *label1,
                           *label2,
                           *label3,
                           ...
                           *label999;
        } Labels;
        can abybody clue on how to use my n index counter to stick
        one of the "labels" so they show up on my arrow window?
        thanks much.
--
 Gary Kline  kline thought org  http://www.thought.org  Public Service
Unix
             Twenty-eight years of service to the Unix community.
This definitely calls for an array:
GtkWidget *label[1000];
as you cannot reference to a variable with a constructed name (like $$a in
PHP). If your struct holds only pointers, though, you can also cast it to
an array:
((GtkWidget **)label_list)[99]
but I haven't tested it, and highly discourage it.
        I will heed your advise!  a workaround may be in three *.c 
        files.  but first:: sleep.
-- 
 Gary Kline  kline thought org  http://www.thought.org  Public Service Unix
             Twenty-eight years of service to the Unix community.
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]