Re: operator overload



On Wed, May 18, 2005 at 03:32:02PM -0300, Renato Araujo wrote:
> How to make the operator overload in gtk?

You can overload operators in C++ (e.g.).  Gtk+ is not
a programming language and has no operators to overload.

> X is a class Y whit 2 operators overload  (GTK_BUTTON  and GTK_LABEL)

Sorry, I can't understand this.

> if (GTK_BUTTON(x)) return the gtk_button; 
> if (GTK_LABEL(x)) return the gtk_label;

  if (GTK_IS_BUTTON(x))
      return gtk_button;
  if (GTK_IS_LABEL(x))
      return gtk_label;
or

  if (GTK_IS_BUTTON(x))
      return GTK_WIDGET(some_button);
  if (GTK_IS_LABEL(x))
      return GTK_WIDGET(some_label);

or whatever.  What do you need to overload?

Yeti


--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?



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