Re: problems implementing own widget



<embedded reply>

Once upon a time Stéphane Konstantaropoulos wrote @ 01 Mar 2003 15:18:34 +0100

Le mer 26/02/2003 à 19:36, Mohammed Sameer a écrit :
Hi all,
As the subject says, I'm having problems implementing a widget for my text editor, Everything seems OK to 
me, but compiling & running the test program yields nothing, I'm sure I'm missing something here.
Can anyone kindly help me or point me to the correct way ??

Best regards,

Thanks for reply,

Your widget contains things, it should then extend a GtkContainer (like
GtkVBox for example, you should create the things it contains and add
them in the "new" function, otherwise nothing will show.

i think i have to inherit a container object and extend it, Since the widget contain other widgets ?
did i get it right ??


so in the .h

struct KatoobDocument {
  GtkVBox parent;  
  KatoobDocument *priv;
};

Then in the new:

this->priv->textview = GTK_TEXT_VIEW(gtk_text_view_new());
gtk_container_add(GTK_CONTAINER(this), this->priv->textview);
...

for example.

Use gob2 for doing OO with gobject, it is much simpler than writing
everything yourself.

Check lumiere (my app) at http://brain.shacknet.nu/lumiere.html

All the code was created with gob.

yes had a look there, though gob2 seems more complicated than writing the C files myself ;)

Many thanks, I'll try to do it again now.

-- 
----------------
-- Katoob Main Developer
Linux registered user # 224950
ICQ # 58475622
FIRST  make  it  run, THEN make it run fast "Brian Kernighan".

Attachment: pgpHM0hX425Un.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]