Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv30680/src/cbits/GTK
Modified Files:
EditBox.c
Log Message:
fix
Index: EditBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/EditBox.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** EditBox.c 26 Mar 2003 17:11:48 -0000 1.5
--- EditBox.c 26 Mar 2003 19:18:12 -0000 1.6
***************
*** 1,60 ****
! #include "EditBox.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! WindowHandle osCreateEdit(WindowHandle window)
! {
! GtkWidget *entry;
!
! entry = gtk_entry_new();
! gtk_fixed_put(GTK_FIXED(GTK_BIN(GetSW(window)->child)->child), entry, 0, 0);
! gtk_widget_show(entry);
! return entry;
! };
!
! void osGetEditReqSize(WindowHandle edit, int *res)
! {
! int w,h;
! GtkRequisition requisition;
!
! gtk_widget_get_size_request(edit, &w,&h);
! gtk_widget_set_size_request(edit, -1,-1);
! gtk_widget_size_request(edit, &requisition);
! gtk_widget_set_size_request(edit, w, h);
!
! res[0] = requisition.width;
! res[1] = requisition.height;
! }
!
! char *osGetEditText(WindowHandle entry)
! {
! char *text = gtk_entry_get_text(GTK_ENTRY(entry));
! char *buffer = (char *) rmalloc(strlen(text)+1);
! strcpy(text,buffer);
! return buffer;
! };
!
! void osSetEditText(WindowHandle entry, char *txt)
! {
! gtk_entry_set_text(GTK_ENTRY(entry), txt);
! };
!
! void osSetEditReadOnly(WindowHandle entry, BOOL readOnly)
! {
! gtk_editable_set_editable(GTK_EDITABLE(entry), !readOnly);
! }
!
! BOOL osGetEditReadOnly(WindowHandle entry)
! {
! return !gtk_editable_get_editable(GTK_EDITABLE(entry));
! }
!
! void osSetEditVisibility(WindowHandle entry, BOOL visible)
! {
! gtk_entry_set_visibility(GTK_ENTRY(entry), visible);
! }
!
! BOOL osGetEditVisibility(WindowHandle editbox)
! {
! return gtk_entry_get_visibility(GTK_ENTRY(entry));
! }
\ No newline at end of file
--- 1,57 ----
! #include "EditBox.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! WindowHandle osCreateEdit(WindowHandle window)
! {
! GtkWidget *entry;
!
! entry = gtk_entry_new();
! gtk_fixed_put(GTK_FIXED(GTK_BIN(GetSW(window)->child)->child), entry, 0, 0);
! gtk_widget_show(entry);
! return entry;
! };
!
! void osGetEditReqSize(WindowHandle edit, int *res)
! {
! int w,h;
! GtkRequisition requisition;
!
! gtk_widget_get_size_request(edit, &w,&h);
! gtk_widget_set_size_request(edit, -1,-1);
! gtk_widget_size_request(edit, &requisition);
! gtk_widget_set_size_request(edit, w, h);
!
! res[0] = requisition.width;
! res[1] = requisition.height;
! }
!
! char *osGetEditText(WindowHandle entry)
! {
! return strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
! };
!
! void osSetEditText(WindowHandle entry, char *txt)
! {
! gtk_entry_set_text(GTK_ENTRY(entry), txt);
! };
!
! void osSetEditReadOnly(WindowHandle entry, BOOL readOnly)
! {
! gtk_editable_set_editable(GTK_EDITABLE(entry), !readOnly);
! }
!
! BOOL osGetEditReadOnly(WindowHandle entry)
! {
! return !gtk_editable_get_editable(GTK_EDITABLE(entry));
! }
!
! void osSetEditVisibility(WindowHandle entry, BOOL visible)
! {
! gtk_entry_set_visibility(GTK_ENTRY(entry), visible);
! }
!
! BOOL osGetEditVisibility(WindowHandle entry)
! {
! return gtk_entry_get_visibility(GTK_ENTRY(entry));
! }
|