C-KIT-GUI-GTK 0.60
gtk_container.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include "../ut/ut_umem.h"
#include "../gui/gui_types.h"
#include "../gui/gui_base.h"
#include "../gui_gtk2/gtk_base.h"
#include "../gui_gtk2/gtk_container.h"

Functions

int GUI_box_paned_siz (MemObj *mo, int siz)
 
MemObj GUI_box_paned__ (MemObj *box1, MemObj *box2, MemObj *o_par, int mode, int resi, int siz1)
 
MemObj GUI_toolbox__ (MemObj *o_par)
 
MemObj GUI_frame__ (MemObj *o_par, char *ltxt, int border)
 
int GUI_frame_styl (MemObj *o_par, int iCol)
 
MemObj GUI_notebook__ (MemObj *o_par, void *funcnam)
 
MemObj GUI_notebook_add (MemObj *o_ntb, char *title)
 
int GUI_notebook_get (MemObj *o_ntb)
 
void GUI_notebook_set (MemObj *o_ntb, int pgNr)
 
int GUI_notebook_CB (void *ntb, void *nbp, int pgNr, MemObj mo)
 

Variables

GtkWidget * UI_act_wi
 

Detailed Description

=====================================================
List_functions_start:
GUI_frame__ frame around widgets
// GUI_frame_styl modify frame
GUI_toolbox__ removable container for widgets (was GUI_toolbar__)
GUI_box_paned__ get 2 boxes with movable separation-line
GUI_box_paned_siz modify size of primary paned-box
GUI_notebook__ notebook (tabControl, tabPages)
GUI_notebook_add add a page to a notebook
GUI_notebook_set activate page
GUI_notebook_get query active page
List_functions_end:
=====================================================

Function Documentation

int GUI_box_paned_siz ( MemObj *  mo,
int  siz 
)

GUI_box_paned_siz modify size of primary paned-box

MemObj GUI_box_paned__ ( MemObj *  box1,
MemObj *  box2,
MemObj *  o_par,
int  mode,
int  resi,
int  siz1 
)
GUI_box_paned__ get 2 boxes with movable separation-line
Input:
o_par parentBox
mode 0 = vertical separation-line, returns 2 horizontal boxes
1 = horizontal separation-line, returns 2 vertical boxes
resi 0 = make box1 fixed, box2 resizable
1 = make box1 resizable, box2 fixed.
siz1 initial size of box1 in pixels
Output:
box1
box2
MemObj GUI_toolbox__ ( MemObj *  o_par)
GUI_toolbox__ removable container for widgets
parent and child must be a box.
Example:
tb = GUI_toolbar__ (&parentBox);
box0 = GUI_box_h (&tb, "");
GUI_button__ (&box0, ..);
GUI_set_show (&tb, 1);
hide / restore toolbox: GUI_set_show
GUI_toolbar__ can be used after activating its parent-window (GUI_Win_go)
MemObj GUI_frame__ ( MemObj *  o_par,
char *  ltxt,
int  border 
)
draws a frame around 1-n widgets. Parent & child must be a box.
ltxt no Text: set to NULL
border outside frame in pixels
Example:
w1 = GUI_box_h (&win, 1, "");
w2 = GUI_frame__ (&w1, "FrameTitel", 1);
w3 = GUI_box_h (&w2, "");
w_info = GUI_label__(&w3, "text", "");
int GUI_frame_styl ( MemObj *  o_par,
int  iCol 
)
MemObj GUI_notebook__ ( MemObj *  o_par,
void *  funcnam 
)
Create a new Notebook.
Add Pages with GUI_notebook_add.
funcnam is called when noteBook-pages change; first Page has Nr 0.
Input:
o_par parentBox
funcnam callbackfunktion for noteBook-pages changes.
funcnam prototyp:
int funcnam (MemObj *mo, void **data);
// data=table of 2 pointers;
GUI_DATA_EVENT = TYP_EventEnter or TYP_EventRelease
GUI_DATA_I1 = pageNumber
GUI_OBJ_TYP(mo) = TYP_GUI_Notebook;
Example:
MemObj ntb, box1, box2;
ntb = GUI_notebook__ (&box, my_Notebook_CB);
box1 = GUI_notebook_add (&ntb, "Page 1");
box2 = GUI_notebook_add (&ntb, "Page 2");
..
int my_Notebook_CB (MemObj *mo, void **data) {
int iTyp;
if(GUI_DATA_EVENT == TYP_EventRelease) return 0; // skip disactivate
iTyp = GUI_OBJ_TYP (mo);
if(GUI_DATA_EVENT == TYP_EventEnter) {
if(iTyp == TYP_GUI_Notebook)
printf(" page %d selected\n",GUI_DATA_I1);
}
}
change page:
GUI_notebook_set (&ntb, iPagNr);
MemObj GUI_notebook_add ( MemObj *  o_ntb,
char *  title 
)
create new page in Notebook.
returns a VBOX in the new Notebook-Page.
Notebook-Page cannot be disabled (all its widgets are disabled)
only hidden
int GUI_notebook_get ( MemObj *  o_ntb)

GUI_notebook_get query active page

void GUI_notebook_set ( MemObj *  o_ntb,
int  pgNr 
)

activate notebook-page; first=0, next=1 ..

int GUI_notebook_CB ( void *  ntb,
void *  nbp,
int  pgNr,
MemObj  mo 
)

INTERNAL callback of switch-notebook-page

Variable Documentation

GtkWidget* UI_act_wi