Page 1 of 1

gtklabel structure (pb 4.20) is different gtklabel.h

Posted: Wed Nov 13, 2013 5:27 pm
by thierry94
hi.

why the gtklabel structure of purebasic 4.20 is different of /usr/include/gtk-2.0/gtk/gtklabel.h ?
How corrected the structure ?

thx

Code: Select all

Structure GtkLabel
  misc.GtkMisc
  *label
  packed_flags.l
  mnemonic_keyval.l
  *text
  *attrs.PangoAttrList
  *effective_attrs.PangoAttrList
  *layout.PangoLayout
  *mnemonic_widget.GtkWidget
  *mnemonic_window.GtkWindow
  *select_info.GtkLabelSelectionInfo
EndStructure

Code: Select all

/usr/include/gtk-2.0/gtk/gtklabel.h
struct _GtkLabel
{               
  GtkMisc misc; 

  /*< private >*/
  gchar  *GSEAL (label);
  guint   GSEAL (jtype)            : 2;
  guint   GSEAL (wrap)             : 1;
  guint   GSEAL (use_underline)    : 1;
  guint   GSEAL (use_markup)       : 1;
  guint   GSEAL (ellipsize)        : 3;
  guint   GSEAL (single_line_mode) : 1;
  guint   GSEAL (have_transform)   : 1;
  guint   GSEAL (in_click)         : 1;
  guint   GSEAL (wrap_mode)        : 3;
  guint   GSEAL (pattern_set)      : 1;
  guint   GSEAL (track_links)      : 1;

  guint   GSEAL (mnemonic_keyval);

  gchar  *GSEAL (text);
  PangoAttrList *GSEAL (attrs);
  PangoAttrList *GSEAL (effective_attrs);

  PangoLayout *GSEAL (layout);

  GtkWidget *GSEAL (mnemonic_widget);
  GtkWindow *GSEAL (mnemonic_window);

  GtkLabelSelectionInfo *GSEAL (select_info);
};

Re: gtklabel structure (pb 4.20) is different gtklabel.h

Posted: Fri Nov 15, 2013 9:48 pm
by idle
It's not different, PB doesn't handle bitfields. In the port of the structure they're all part of packed_flags.l
whenever you see ":" in a c structure, it's a bit field followed by the number of bits used.
guint GSEAL (jtype) :2;
guint GSEAL (wrap) : 1;
...

Re: gtklabel structure (pb 4.20) is different gtklabel.h

Posted: Wed Dec 11, 2013 11:35 am
by thierry94
thx

how modified bit fields in PB Structures

Re: gtklabel structure (pb 4.20) is different gtklabel.h

Posted: Wed Dec 11, 2013 8:01 pm
by idle
je ne comprand pas!

Are you asking how to set and get the bit fields in a structure?

You set them by using or "|" with constant, like you do with the options opening a window

or is the pb version of the structure the wrong size?
It looked ok to me but I haven't tested it.