[lazarus] Weird behavior of the day....

Noel Cuillandre noel_cuillandre at wanadoo.fr
Sat Aug 7 17:03:24 EDT 1999


i'm developping under win32 and till now, i was unable to see a file
when i tried to open one ( as result, i had an empty window ).
To solve this problem, i have swapped some lines of code in the
'gtkfilesel.pp' file.
the original code was :
  type
     PGtkFileSelection = ^TGtkFileSelection;
     TGtkFileSelection = record
          window : TGtkWindow;
          dir_list : PGtkWidget;
          file_list : PGtkWidget;
          selection_entry : PGtkWidget;
          selection_text : PGtkWidget;
          main_vbox : PGtkWidget;
          ok_button : PGtkWidget;<<------
          cancel_button : PGtkWidget;<<-- These lines have to be swapped
          help_button : PGtkWidget;<<----
          history_pulldown : PGtkWidget;
          history_menu : PGtkWidget;
          history_list : PGList;
          fileop_dialog : PGtkWidget;
          fileop_entry : PGtkWidget;
          fileop_file : ^gchar;
          cmpl_state : gpointer;
          fileop_c_dir : PGtkWidget;
          fileop_del_file : PGtkWidget;
          fileop_ren_file : PGtkWidget;
          button_area : PGtkWidget;
          action_area : PGtkWidget;
       end;
And now the modified code of 'gtkfilesel.pp' file :
  type
     PGtkFileSelection = ^TGtkFileSelection;
     TGtkFileSelection = record
          window : TGtkWindow;
          dir_list : PGtkWidget;
          file_list : PGtkWidget;
          selection_entry : PGtkWidget;
          selection_text : PGtkWidget;
          main_vbox : PGtkWidget;
          help_button : PGtkWidget;<<----
          ok_button : PGtkWidget;<<------ These lines have BEEN swapped
          cancel_button : PGtkWidget;<<--
          history_pulldown : PGtkWidget;
          history_menu : PGtkWidget;
          history_list : PGList;
          fileop_dialog : PGtkWidget;
          fileop_entry : PGtkWidget;
          fileop_file : ^gchar;
          cmpl_state : gpointer;
          fileop_c_dir : PGtkWidget;
          fileop_del_file : PGtkWidget;
          fileop_ren_file : PGtkWidget;
          button_area : PGtkWidget;
          action_area : PGtkWidget;
       end;
after this change, when opening a file, the code appears colorized in a
window.But there is some strange 'empty square' cars which appears also
maybe is a UNIX / Window text conversion problem.
 

Cliff Baeseman a écrit :
> 
> Here is something a little funny I found under Win32....  I am not sure of
> the cause or fix to this
> little bug.
> 
> The text is not showing under win32 because a signal is not being connected
> to the OK button.
> 
> below is what I did to fix it, but this is totally hosed. The declaration
> order in the gtk units is like this
> 
> main_vbox: PGtkWidget
> ok_button: PGtkWidget
> cancel_button: PGtkWidget
> help_button: PGtkWidget;
> 
> Here is the original
> 
> gtk_signal_connect( gtk_object(pGtkButton((PGtkFileSelection(P))^.ok_button)
> ), 'clicked',   gtk_signal_func(@gtkDialogOKclickedCB), Sender);
> 
> gtk_signal_connect( gtk_object((PGtkFileSelection(P))^.cancel_button),
> 'clicked', gtk_signal_func(@gtkDialogCancelclickedCB), Sender);
> 
> A gtk error was being thrown saying that signal clicked could not be found
> in the vbox classes. I moved down the declaration list and put cancel where
> ok should be and help where cancel should be and low and behold it works
> like it is supposed to.
> 
> gtk_signal_connect( gtk_object(pGtkButton((PGtkFileSelection(P))^.cancel_but
> ton)), 'clicked',   gtk_signal_func(@gtkDialogOKclickedCB), Sender);
> 
> gtk_signal_connect( gtk_object((PGtkFileSelection(P))^.help_button),
> 'clicked', gtk_signal_func(@gtkDialogCancelclickedCB), Sender);
> 
> Does this have any thing to do with record packing?
> 
> I am stumped over this one.
> 
> Cliff
> 
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>     archives at http://www.miraclec.com/list_archives/lazarus






More information about the Lazarus mailing list