gtk2forpascal-devel Mailing List for gtk2 for pascal (Page 3)
Brought to you by:
mgaertner
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(30) |
Aug
(22) |
Sep
(2) |
Oct
(6) |
Nov
(8) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2004 |
Jan
|
Feb
|
Mar
(11) |
Apr
|
May
(5) |
Jun
(4) |
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2005 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: mili <mil...@16...> - 2002-08-30 17:26:58
|
Hi, Everyone In gtk2forpascal, TGtkTextSearchFlags is defined as follows: TGtkTextSearchFlags =3D ( GTK_TEXT_SEARCH_VISIBLE_ONLY, GTK_TEXT_SEARCH_TEXT_ONLY ); Then the following C codes can't be converted to Pascal: search_flags =3D GTK_TEXT_SEARCH_VISIBLE_ONLY | GTK_TEXT_SEARCH_TEXT_O= NLY; to search_flags :=3D GTK_TEXT_SEARCH_VISIBLE_ONLY or GTK_TEXT_SEARCH_TEXT= _ONLY; Because bit operator can't be operated on enum type. And at the same t= ime, gedit_text_iter_forward_search() function in pascal will ask for a enu= m=20 type, anything else is unacceptable. So, How can I do? I think this is a bug of gtk2forpascal, for the developers have not=20 anticipate the incompatibility between Pascal and C. Yours, mili |
From: mili <mil...@16...> - 2002-08-30 17:24:01
|
Hi, Everyone In gtk2forpascal, TGtkTextSearchFlags is defined as follows: TGtkTextSearchFlags = ( GTK_TEXT_SEARCH_VISIBLE_ONLY, GTK_TEXT_SEARCH_TEXT_ONLY ); Then the following C codes can't be converted to Pascal: search_flags = GTK_TEXT_SEARCH_VISIBLE_ONLY | GTK_TEXT_SEARCH_TEXT_ONLY; to search_flags := GTK_TEXT_SEARCH_VISIBLE_ONLY or GTK_TEXT_SEARCH_TEXT_ONLY; Because bit operator can't be operated on enum type. And at the same time, gedit_text_iter_forward_search() function in pascal will ask for a enum type, anything else is unacceptable. So, How can I do? I think this is a bug of gtk2forpascal, for the developers have not anticipate the incompatibility between Pascal and C. Yours, mili |
From: Olaf L. <le...@ne...> - 2002-08-27 13:31:04
|
Hi! I've put a cvs-snapshot on my private webspace. You can reach it at: http://www.newcon.de/~leidola/ Ciao, Olaf |
From: mili <mil...@16...> - 2002-08-27 05:37:14
|
Dear, Mattias I don't know for what reason, I can access sourceforge.net from China. = So=20 could you please send me a copy of the newest gtk2forpascal? I am running= a=20 project with it. Thank you very much. Yours, mili |
From: Mattias G. <nc-...@ne...> - 2002-08-26 18:03:47
|
Hi, I have finished 100 ToDos. The remaining ToDos are 6 macros and the examples. Of course there are some big ToDos left: - Kylix support - more testing - there are two compiler bugs, concerning array of const and cdecl;. Mattias |
From: Olaf L. <le...@ne...> - 2002-08-12 13:41:13
|
Hi Mili! I use something like that in my application: TGUI =3D record =20 window : PGtkWidget; (* Hauptfenster *) vbox : PGtkWidget; =20 da : PGtkWidget; (* Zeichenebene *) button : PGtkWidget; (* Knopf *) width : integer; (* breite der Zeichenebene *)=20 height : integer; (* H=F6he der Zeichenebene *) frame : PGdkPixbuf; (* berechnetes Bild *) pix : TBilder; (* Bildelemente *) timeout_id : gint; item_factory : PGtkItemFactory; toolbar : PGtkWidget; end; =20 PSimulation =3D ^TSimulation; TSimulation =3D record =20 next : PSimulation; (* n=E4chste Simulation *) ansicht : TAnsicht; (* Gr=F6=DFe des Feldes *) teilchen : PTeilchen; (* Liste der Teilchen *) zeit : TZeit; gui : TGUI; (* <-------- here is the gui *) end; I create a new instance of PSimulation using the new function and everything works well. The bug might be somewhere else. Perhaps you could send us a sample application that crashes on your system. Ciao, Olaf Am Mon, 2002-08-12 um 10.00 schrieb mili: Hello, Every One I found a possible bug of gtk2forpascal, but I don't know how to fix it. Let's create a new gtk widget: >>>> type PGtkMyWidget =3D ^TGtkMyWidget; ^TGtkMyWidget;=3D record hpaned : TGtkHPaned; tree_sw : PGtkScrolledWindow; tree_view : PGtkTreeView; text_sw : PGtkScrolledWindow; text_view : PGtkTextView; end;//TGtkMyWidget; <<<< What ever the other code about TGtkMyWidget is, it doesn't matter. Then new an instance of TGtkMyWidget, and put it in a window, put a button in the window, and connect the button's click signal to a callback function, in this function you try to access the text_view of TGtkMyWidget. Such as: gtk_text_view_set_editable(the_widget^.text_view,TRUE); Then the program crashes. I also find in many cases, some codes which attempt to access the member of a widget cause the program to crash. Perhaps the problem is the difference of C<--->Pascal programming and memory accessing. I don't know how to fix it. Can anyone find a solution? =20 =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =C3=E2=B7=D1=D3=CA=CF=E4=BD=A1=BF=B5=C9=B1=B6=BE=B4=F3=D0=D0=B6=AF=A3= =A1 =D0=C4=B6=AF=B2=BB=C8=E7=D0=D0=B6=AF =B4=F3=BB=B0=CE=F7=D3=CE2.0=C3=E2= =B7=D1=B2=E2=CA=D4=D6=D0 =CD=F8=D2=D7=B7=C7=B3=A3=C4=D0=C5=AE =B4=AB=B5=DD=B6=CC=D0=C5=C7=E9=B8= =FC=C5=A8 =20 =20 |
From: mili <mil...@16...> - 2002-08-12 08:01:50
|
Hello, Every One I found a possible bug of gtk2forpascal, but I don't know how to fix it. Let's create a new gtk widget: >>>> type PGtkMyWidget = ^TGtkMyWidget; ^TGtkMyWidget;= record hpaned : TGtkHPaned; tree_sw : PGtkScrolledWindow; tree_view : PGtkTreeView; text_sw : PGtkScrolledWindow; text_view : PGtkTextView; end;//TGtkMyWidget; <<<< What ever the other code about TGtkMyWidget is, it doesn't matter. Then new an instance of TGtkMyWidget, and put it in a window, put a button in the window, and connect the button's click signal to a callback function, in this function you try to access the text_view of TGtkMyWidget. Such as: gtk_text_view_set_editable(the_widget^.text_view,TRUE); Then the program crashes. I also find in many cases, some codes which attempt to access the member of a widget cause the program to crash. Perhaps the problem is the difference of C<--->Pascal programming and memory accessing. I don't know how to fix it. Can anyone find a solution? |
From: Tomas B. <tb...@po...> - 2002-08-05 17:51:02
|
Thanks, i will look at it. And what about the next problem, please? (the linking is not necessary at the moment). On Sun, 2002-08-04 at 10:44, Mattias Gaertner wrote: I assume that your libs are not corrupted. The compilation is correct and so is compile_with_fpc_under_linux.sh. So, you still get the wrong linking order. Try to link manually: Compile your program with a small bug to stop the linker: ppc386 -Fu<gtk2_ppu_directory> -k-lboguslib <yourprogram>.pas This should result in a linker error, such as Can't find -lboguslib Now you should have a 'ppas.sh' and a 'link.res' file, created by the compiler. Normally these files are deleted on successful linking. Remove the '-lboguslib' from ppas.sh to get a working script. Calling ./ppas.sh should link the buggy program that you know. Now edit link.res and play around with the order of the libs. Call ppas.sh and start your program to see the result. For example put the ld-linux to the top. Can you send the link.res? Mattias ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Gtk2forpascal-devel mailing list Gtk...@li... https://lists.sourceforge.net/lists/listinfo/gtk2forpascal-devel ---------------- Tomas Bzatek |
From: Mattias G. <nc-...@ne...> - 2002-08-04 08:43:46
|
On 03 Aug 2002 21:01:14 +0200 Tomas Bzatek <tb...@po...> wrote: > Hi, > > first of all, I cannot still run any example compiled by > compile_with_fpc_under_linux.sh and make_examples.sh scripts. > Compilation and linking works without error, but when I try to run an > executable, i got this error: > Inconsistency detected by ld.so: dl-minimal.c: 114: realloc: Assertion > `ptr == alloc_last_block' failed! > What's wrong? I assume that your libs are not corrupted. The compilation is correct and so is compile_with_fpc_under_linux.sh. So, you still get the wrong linking order. Try to link manually: Compile your program with a small bug to stop the linker: ppc386 -Fu<gtk2_ppu_directory> -k-lboguslib <yourprogram>.pas This should result in a linker error, such as Can't find -lboguslib Now you should have a 'ppas.sh' and a 'link.res' file, created by the compiler. Normally these files are deleted on successful linking. Remove the '-lboguslib' from ppas.sh to get a working script. Calling ./ppas.sh should link the buggy program that you know. Now edit link.res and play around with the order of the libs. Call ppas.sh and start your program to see the result. For example put the ld-linux to the top. Can you send the link.res? Mattias |
From: Olaf L. <le...@ne...> - 2002-08-04 08:40:12
|
Hi! Inconsistency detected by ld.so: dl-minimal.c: 114: realloc: Assertion `ptr == alloc_last_block' failed! I got the same error but after using the latest scripts on cvs it was okay. The reason was probably the wrong linking order (for me). Did you try them? Ciao, Olaf |
From: Tomas B. <tb...@po...> - 2002-08-03 19:02:47
|
Hi, first of all, I cannot still run any example compiled by compile_with_fpc_under_linux.sh and make_examples.sh scripts. Compilation and linking works without error, but when I try to run an executable, i got this error: Inconsistency detected by ld.so: dl-minimal.c: 114: realloc: Assertion `ptr == alloc_last_block' failed! What's wrong? My next question is: what's the equivalent function for gtk_menu_ensure_uline_accel_group in GTK2? I've used this function for adding accelerators for letters in manual menu creation, which were underlined in text of the menuitem. This caused activating the item, for example when you opened the menu by Alt+F (_File), and then you pressed the letter O (_Open). This function returned an AccelGroup object, which was used for the specified menu. I tried to make the local AccelGroup manually, assigning to menu using gtk_menu_set_accel_group, and adding the accelerator into it, but this doesn't work. I have also take a look on ItemFactory, but I don't know, how to change the data of the item, for example the text or the accelerator. ---------------- Tomas Bzatek |
From: Olaf L. <le...@ne...> - 2002-08-02 14:26:31
|
Hi again! Why don't you create your own widget? Have a look at the tutorial at gtk.org. I think this might be easier. No, I was wrong.... this won't help you. But you can create your own record type that contains all the variables you need and some functions that allocate / deallocate memory for the record and some function that can access the record and manipulate it. This is the way I'd do it. Ciao, Olaf |
From: Olaf L. <le...@ne...> - 2002-08-02 14:08:51
|
Hi Mili! 1. When program start, there are 4 errors occor.=20 2. When you click the button on the window, the program crash!!!=20 Sorry, I can't help you. But here are my thoughts: First of all it doesn't crash on my system. One reason for the crash might be the lack of a cdecl after the callback functions. But I don't think that this is the reason. I've debuged it using gdb (or kdbg). The first error is created in line 275 (gtk_tree_view_column_add_attribute) but it's a bit suspect for me. An other thing I've noticed is that you call gtk_init two times, in the unit and in the app. I'm not famillar with classes in pascal - but why do you want to put all this code into a class? As far as I can read your code you'd linke to combine several widgets to a class. I think there are better ways. I once tried this in cpp but I failed (because of c++) Why don't you create your own widget? Have a look at the tutorial at gtk.org. I think this might be easier. Ciao, Olaf =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =C3=E2=B7=D1=D3=CA=CF=E4=BD=A1=BF=B5=C9=B1=B6=BE=B4=F3=D0=D0=B6=AF=A3= =A1 =D0=C4=B6=AF=B2=BB=C8=E7=D0=D0=B6=AF =B4=F3=BB=B0=CE=F7=D3=CE2.0=C3=E2= =B7=D1=B2=E2=CA=D4=D6=D0 =CD=F8=D2=D7=B7=C7=B3=A3=C4=D0=C5=AE =B4=AB=B5=DD=B6=CC=D0=C5=C7=E9=B8= =FC=C5=A8 =20 =20 =20 |
From: Olaf L. <le...@ne...> - 2002-08-02 11:06:24
|
Hello! I've uploaded two batch files for win32 to cvs. Using them you can compile both, all examples and the units. It's for all who can't or don't want to use cygwin or msys. ciao, Olaf |
From: Olaf L. <le...@ne...> - 2002-08-01 12:05:12
|
Hi everybody! I found the bug that made gtk-demo crash when closing a demo window. In the window_close_cb I tried to free memory using g_free that was allocated with new() . A new version is on cvs. ciao Olaf |
From: Olaf L. <le...@ne...> - 2002-08-01 08:25:58
|
Am Don, 2002-08-01 um 10.01 schrieb Mattias Gaertner: On Thu, 1 Aug 2002 10:17:23 +0800 (CST) "mili" <mil...@16...> wrote: > Hello, Every one > > I run xpm2pasxpm.sh to convert a *.xpm file, but the new > *.pas_xpm is not correct. I have to delete the extra chars before > the variable defination manualy. > > Anyway, It can works. The xpm format is not very strict. Perhaps your xpm looks somewhat different then my template. Can you send me an example? Hi! I've patched your script. It works with the hi-color xpms I have. Have a try... Ciao, Olaf Mattias ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Gtk2forpascal-devel mailing list Gtk...@li... https://lists.sourceforge.net/lists/listinfo/gtk2forpascal-devel |
From: Mattias G. <nc-...@ne...> - 2002-08-01 08:06:39
|
On Thu, 1 Aug 2002 10:17:23 +0800 (CST) "mili" <mil...@16...> wrote: > Hello, Every one > > I run xpm2pasxpm.sh to convert a *.xpm file, but the new > *.pas_xpm is not correct. I have to delete the extra chars before > the variable defination manualy. > > Anyway, It can works. The xpm format is not very strict. Perhaps your xpm looks somewhat different then my template. Can you send me an example? Mattias |
From: mili <mil...@16...> - 2002-08-01 02:17:44
|
Hello, Every one I run xpm2pasxpm.sh to convert a *.xpm file, but the new *.pas_xpm is not correct. I have to delete the extra chars before the variable defination manualy. Anyway, It can works. |
From: Olaf L. <le...@ne...> - 2002-07-31 21:39:12
|
Hi! Well, again, (*g*) the new script doesn't work for me. The reason is again the -L option. We need to convert this to SEARCH_DIR( [some_dir] ) for each -L option, but I'm not very good at shell-scripting. The problem is that I don't know how to split this string into tokens. This is no problem for pascal or c, but for shell-scripts. Okay, forget it! A new version is on cvs Ciao, Olaf |
From: Olaf L. <le...@ne...> - 2002-07-31 18:18:47
|
Hi everybody! Well, again, (*g*) the new script doesn't work for me. The reason is again the -L option. We need to convert this to SEARCH_DIR( [some_dir] ) for each -L option, but I'm not very good at shell-scripting. The problem is that I don't know how to split this string into tokens. This is no problem for pascal or c, but for shell-scripts. If know any command command please tell me, Ciao, Olaf Am Die, 2002-07-30 um 23.18 schrieb Mattias Gaertner: I have fixed the make_examples.sh script. We don't need the sed anymore and with the smaller ld line, even the pl= ugin lib can be compiled. This is still a dirty solution, but probably that's the price for using= dirty c libraries. =20 =20 Mattias =20 =20 =20 On 30 Jul 2002 21:27:04 +0200 Olaf Leidinger <le...@ne...> wrote: =20 =20 > Well, the new script doesn't work for me. First of all the -L option = isn't converted to -k-L.=20 > I've patched this. But even then it sais >=20 > Free Pascal Compiler version 1.0.6 [2002/05/23] for i386 > Copyright (c) 1993-2002 by Florian Klaempfl > Target OS: Linux for i386 > Compiling ./glib/plugins/main.pas > Assembling plugin_test > Linking ./glib/plugins/main > /usr/local/bin/ld: cannot open =CC=E5=FF=BF=D2:: Datei oder Verzeichn= is nicht > gefunden > main.pas(48) Error: Error while linking > Closing script ppas.sh >=20 > My link.res and my ppas.sh are attached. >=20 > For me everything looks okay - but only for me, not for the linker ;-= ) >=20 > Ciao, >=20 > Olaf >=20 >=20 >=20 >=20 =20 =20 ------------------------------------------------------- This sf.net email is sponsored by: Dice - The leading online job board for high-tech professionals. Search and apply for tech jobs today! http://seeker.dice.com/seeker.epl?rel_code1 _______________________________________________ Gtk2forpascal-devel mailing list Gtk...@li... https://lists.sourceforge.net/lists/listinfo/gtk2forpascal-devel =20 =20 |
From: Olaf L. <le...@ne...> - 2002-07-31 17:38:46
|
Hi Mili! Well, I've written and tested them using win32 and there they work. It might be that there are some variables uninitialized so it needs to be tested. If you find the error you can send us a patch ;-) Happy bug-hunting! Ciao, Olaf Am Mit, 2002-07-31 um 03.37 schrieb mili: Hello, Everyone This morning, I am so happy to download the latest tar file of gtk2forpascal, With compiling it, I find it can successfully run examples under linux. But I noticed that when I run ./gtk-demo, and triger an example of it, it can work well, however, when I click the "Close" button to close this example, the whole program halted. |
From: Mattias G. <nc-...@ne...> - 2002-07-31 13:54:32
|
On Wed, 31 Jul 2002 15:21:16 +0200 Mattias Gaertner <nc-...@ne...> wrote: > On Wed, 31 Jul 2002 20:05:15 +0800 (CST) > "mili" <mil...@16...> wrote: > > > Hello, Every one > > > > I know that with C I can include a xpm file and then my > > executable can run independent on any other file. But I don't know > > how to do it under Pascal. > > XPM files are just c constants. You can include them in pascal if you translate them into a PPChar, i.e. an array of PChar. Perhaps I will write a small script to do this automatically. I have added a script named xpm2pasxpm.sh to cvs. It converts an .xpm into an .pas_xpm, which can be included into pascal. Mattias |
From: Mattias G. <nc-...@ne...> - 2002-07-31 13:27:00
|
On Wed, 31 Jul 2002 20:05:15 +0800 (CST) "mili" <mil...@16...> wrote: > Hello, Every one > > I know that with C I can include a xpm file and then my > executable can run independent on any other file. But I don't know > how to do it under Pascal. XPM files are just c constants. You can include them in pascal if you translate them into a PPChar, i.e. an array of PChar. Perhaps I will write a small script to do this automatically. > I notice that when I remove all picture > files under examples/gtk+/demo/data, the gtk_demo report no picture > file found. Makes sense to me. What's the problem about it? > And another question. I try to construct a menu with the > following code: > >>>>> > const > MenuItems : array [1..5] of TGtkItemFactoryEntry =( > ( path: '/_File'; accelerator: NULL; callback: nil; > callback_action: 0; item_type: '<Branch>'; extra_data: NULL ), > ( path: '/File/_New'; accelerator: '<control>N'; callback: > TGtkItemfactoryCallback(@file_new_clicked); callback_action: 0; > item_type : '<StockItem>'; extra_data: NULL), > ( path: '/File/_Open'; accelerator: '<control>O'; callback: > TGtkItemfactoryCallback(@file_open_clicked); callback_action: 0; > item_type : '<StockItem>'; extra_data: NULL), > ( path: '/File/sep1'; accelerator: NULL; callback: nil; > callback_action: 0; item_type: '<Separator>' ), > ( path: '/File/_Close'; accelerator: '<control>Q'; callback: > TGtkItemfactoryCallback(@file_close_clicked); callback_action: 0; > item_type : '<StockItem>'; extra_data: NULL) > ); > <<<<<<< > > Then When I run it, it can work well but report some error in > console: > > (gbase:1133): Gtk-CRITICAL **: file gtkstock.c: line 128 > (gtk_stock_lookup): assertion `stock_id != NULL' failed > > > What's the problem? In the last line you have to give a stock id. For example: Add this line to your start code: menu_items[2].extra_data:=Pointer(GTK_STOCK_NEW); Due to the strict type checking of pascal it is impossible to set this constant directly. Mattias |
From: mili <mil...@16...> - 2002-07-31 12:05:35
|
Hello, Every one I know that with C I can include a xpm file and then my executable can run independent on any other file. But I don't know how to do it under Pascal. I notice that when I remove all picture files under examples/gtk+/demo/data, the gtk_demo report no picture file found. Can you help me? And another question. I try to construct a menu with the following code: >>>>> const MenuItems : array [1..5] of TGtkItemFactoryEntry =( ( path: '/_File'; accelerator: NULL; callback: nil; callback_action: 0; item_type: '<Branch>'; extra_data: NULL ), ( path: '/File/_New'; accelerator: '<control>N'; callback: TGtkItemfactoryCallback(@file_new_clicked); callback_action: 0; item_type : '<StockItem>'; extra_data: NULL), ( path: '/File/_Open'; accelerator: '<control>O'; callback: TGtkItemfactoryCallback(@file_open_clicked); callback_action: 0; item_type : '<StockItem>'; extra_data: NULL), ( path: '/File/sep1'; accelerator: NULL; callback: nil; callback_action: 0; item_type: '<Separator>' ), ( path: '/File/_Close'; accelerator: '<control>Q'; callback: TGtkItemfactoryCallback(@file_close_clicked); callback_action: 0; item_type : '<StockItem>'; extra_data: NULL) ); <<<<<<< Then When I run it, it can work well but report some error in console: (gbase:1133): Gtk-CRITICAL **: file gtkstock.c: line 128 (gtk_stock_lookup): assertion `stock_id != NULL' failed What's the problem? Thank you very much! |
From: mili <mil...@16...> - 2002-07-31 01:37:57
|
Hello, Everyone This morning, I am so happy to download the latest tar file of gtk2forpascal, With compiling it, I find it can successfully run examples under linux. But I noticed that when I run ./gtk-demo, and triger an example of it, it can work well, however, when I click the "Close" button to close this example, the whole program halted. And this is the error report: An unhandled exception occurred at 0x4207ABFD : Access violation 0x4207ABFD 0x403A4E06 0x08085888 0x4035E428 0x40348F7A 0x4035D5F4 0x4035BE33 0x401254D5 0x40102C43 0x401B0A65 Anyway, the whole interface can work perfectly under linux, I love it. Thanks for your work! Yours, mili |