gtklabel structure (pb 4.20) is different gtklabel.h

Linux specific forum
thierry94
User
User
Posts: 14
Joined: Mon Oct 08, 2007 12:37 pm
Location: france

gtklabel structure (pb 4.20) is different gtklabel.h

Post 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);
};
User avatar
idle
Always Here
Always Here
Posts: 5097
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

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

Post 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;
...
Windows 11, Manjaro, Raspberry Pi OS
Image
thierry94
User
User
Posts: 14
Joined: Mon Oct 08, 2007 12:37 pm
Location: france

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

Post by thierry94 »

thx

how modified bit fields in PB Structures
User avatar
idle
Always Here
Always Here
Posts: 5097
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

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

Post 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.
Windows 11, Manjaro, Raspberry Pi OS
Image
Post Reply