Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-04

ICQ

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Cliff Baeseman
to Michael Van Canneyt: Which pointer ? Var Gb,Gl,Child : PGtkWidget; // or whatever pc : pchar;…

Michael Van Canneyt wrote:

I tried the code you sent and cannot get it to work I have tried every thing I could think of.

No matter what kind of widget i pass to gtk_label(pgtkwidget) I get a nill result.

I am at a loss over this one. I would really hate to blast a object and recreate it just to change the caption.

Cliff

Show quoted text 49 lines
On Wed, 21 Apr 1999, Cliff Baeseman wrote: > Guys > > here is the question of the year. How do I convert this structure to > pascal . How dou you implement the pointer? Which pointer ? > > This is to allow dynamic changing of captions in the fcl. We have to > gain access to the label object at the top of the hiarchy. > > Cliff > > > > gtk_label_set(GTK_LABEL(GTK_BIN(mywidget)) -> child),'new text') > Var Gb,Gl,Child : PGtkWidget; // or whatever pc : pchar; gb:=gtk_bin(mywidget); gl:=gtk_label(gb); <<<<<<<<<<<<< this always returns nil??? child:=gl^.child gtk_label_set(child,'new text'); You may need some typecasting here, but this should be it ? Michael > > > > Shane Miller wrote: > > > You using ICQ on your linux yet so I can tell when you are on? My > > ICQ # is 188007. Your old one (in case you lost it) was > > 36008926 Shane > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject
Cliff Baeseman

Guys

here is the question of the year. How do I convert this structure to pascal . How dou you implement the pointer?

This is to allow dynamic changing of captions in the fcl. We have to gain access to the label object at the top of the hiarchy.

Cliff

gtk_label_set(GTK_LABEL(GTK_BIN(mywidget)) -> child),'new text')

Shane Miller wrote
You using ICQ on your linux yet so I can tell when you are on? My ICQ # is 188007. Your old one (in case you lost it) was 36008926 Shane
Michael Van Canneyt
to Cliff Baeseman
Cliff Baeseman wrote
Guys here is the question of the year. How do I convert this structure to pascal . How dou you implement the pointer?

Which pointer ?

Show quoted text 10 lines
This is to allow dynamic changing of captions in the fcl. We have to gain access to the label object at the top of the hiarchy. Cliff gtk_label_set(GTK_LABEL(GTK_BIN(mywidget)) -> child),'new text')
Var Gb,Gl,Child : PGtkWidget; // or whatever
    pc : pchar;
  gb:=gtk_bin(mywidget);
  gl:=gtk_label(gb);
  child:=gl^.child
  gtk_label_set(child,'new text');

You may need some typecasting here, but this should be it ?

Michael

Show quoted text 13 lines
Shane Miller wrote: > You using ICQ on your linux yet so I can tell when you are on? My > ICQ # is 188007. Your old one (in case you lost it) was > 36008926 Shane _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject
Michael Van Canneyt
to Cliff Baeseman: I tried the code you sent and cannot get it to work I have tried every thing I could…
Cliff Baeseman wrote 11 lines
Michael Van Canneyt wrote: I tried the code you sent and cannot get it to work I have tried every thing I could think of. No matter what kind of widget i pass to gtk_label(pgtkwidget) I get a nill result. I am at a loss over this one. I would really hate to blast a object and recreate it just to change the caption.

[CUT]

A had a probably typed this from memory.
Of course it doesn't work. The parentheses are wrong, so I gave a wrong translation !!

> > > > gtk_label_set(GTK_LABEL(GTK_BIN(mywidget)) -> child),'new text')

only 3 '(' and 4 ')' !!

Probably, it must be
gtk_label_set(GTK_LABEL(GTK_BIN(mywidget) -> child),'new text')

in that case, the translation is:

Var Gb,Child : PGtkWidget; // or whatever
    pc : pchar;
   gb:=gtk_bin(mywidget);
   child:=gtk_label(gb^.Child);
   gtk_label_set(child,'new text');

I'm not surprised you always got nil :)

This is, BTW, in perfect agreement with my other mail: GTKButton doesn't descend from label, it HAS a label: The child !

So now it should work.

Michael.