4.12.06

Merged..

Finally I merged the two development branches, most widgets are working again. There are still some widgets, which are not yet converted to glib objects (handle_box menu, toolbar,grab and messagedialog), but the others (appr. 50 widgets) are converted.

It is now much easier, to add a new widget to gtk-mui. You can use the original GTK header and use most of the original GTK widget source. You just have to replace all widget displaying code with MUI calls. This might work without a custom class (tooltips for example) or might require quite complex MUI classes (spinbutton for example).

In GTK you have the following widget hierarchy:

GObject
|
GtkObject
+GtkWidget
| +GtkMisc
| | +GtkLabel

The further you go down the tree, the more properties a widget has. In order to be able to store MUI properties for every widget without having to modify the GTK headers, I added a GtkMui widget:

GObject
|
GtkMui
|
GtkObject
+GtkWidget
| +GtkMisc
| | +GtkLabel

If you now want to be able to create a new GtkLabel object with

GtkLabel *label;
label=gtk_label_new("test");

you simply have to add the following to the widget init code in gtk_label.c:

GTK_MUI(label)->MuiObject = NewObject(CL_Label->mcc_Class,NULL,TAG_DONE);
set(GTK_MUI(label)->MuiObject,MUIA_Text_Contents,label->text);

You'll need the according MUI Label class of course ;).

0 Comments:

Post a Comment

<< Home