gtk +xml tutorial why not work?
Re: gtk +xml tutorial why not work?
gtk 3 and gtk 2
wich version 32 or 64 ?
wich version 32 or 64 ?
Re: gtk +xml tutorial why not work?
I USE GTK3 32BIT
i copy gtk static lib in c:\opt\gtk3 , i copy gir header in freebasic , folder inc
i modify header
this is what return
Command executed:
"C:\FreeBasic\fbc.exe" "C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas"
Compiler output:
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(9) error 42: Variable not declared, LIBPATH in 'LIBPATH="C:\opt\GTK3"'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(25) error 42: Variable not declared, g_message in 'g_message("ClickButton clicked!")'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(34) error 42: Variable not declared, Ui_filename in 'IF 0 = gtk_builder_add_from_file(xml, Ui_filename, @mess) THEN'
Results:
Compilation failed
System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win32 (32bit)
OS: Windows NT 6.2 (build 9200)
i copy gtk static lib in c:\opt\gtk3 , i copy gir header in freebasic , folder inc
i modify header
Code: Select all
' GtkBuilder.bas
' GPLv3: Copyright by TJF, 2011
' (replacement for glade_gui.bas and glade-xml.bas)
' Details: http://developer.gnome.org/gtk/
'#DEFINE __USE_GTK3__
LIBPATH="C:\opt\GTK3"
'#INCLUDE ONCE "gtk/gtk.bi"
#INCLUDE ONCE "Gir/GTK-3.0.bi"
'#INCLUDE ONCE "Gir/_GLibMacros-2.0.bi"
' Note:
' one source code, different GUIs. Choose one
'#DEFINE Ui_filename "GtkBuilder1.ui" ' simple 'Click me!' button
'#DEFINE Ui_filename "GtkBuilder2.ui" ' complex UI with notebook
' try tab 'Buttons' -> 'Hello' button (check console output)
' try tab 'Listview' -> sort column by clicking on header
' -> reorder column by dragging with mouse
SUB on_ClickButton_clicked CDECL ALIAS "on_ClickButton_clicked" ( _
BYVAL button AS GtkButton PTR, _
BYVAL user_data AS gpointer) EXPORT
g_message("ClickButton clicked!")
END SUB
gtk_init( NULL, NULL )
VAR xml = gtk_builder_new()
DIM AS GError PTR mess
IF 0 = gtk_builder_add_from_file(xml, Ui_filename, @mess) THEN
?"Fehler/Error (GTK-Builder):"
?*mess->message
END 2
END IF
gtk_builder_connect_signals( xml, NULL )
gtk_main( )
g_object_unref( xml )
END 0
this is what return
Command executed:
"C:\FreeBasic\fbc.exe" "C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas"
Compiler output:
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(9) error 42: Variable not declared, LIBPATH in 'LIBPATH="C:\opt\GTK3"'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(25) error 42: Variable not declared, g_message in 'g_message("ClickButton clicked!")'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(34) error 42: Variable not declared, Ui_filename in 'IF 0 = gtk_builder_add_from_file(xml, Ui_filename, @mess) THEN'
Results:
Compilation failed
System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win32 (32bit)
OS: Windows NT 6.2 (build 9200)
Re: gtk +xml tutorial why not work?
libpath should be of the form
#LIBPATH "C:\opt\GTK3"
You are using fbide, why not get the .chm help file and point fbide to it under view-settings-freebasic.
Then all you have to is is put your cursor over any keyword and press F1.
You will soon see that libpath is not a keyword.
All other errors follow on from the first.
If you use win 10 you may have to activate the .chm by right clicking it, get properties and unchecking the little box.
#LIBPATH "C:\opt\GTK3"
You are using fbide, why not get the .chm help file and point fbide to it under view-settings-freebasic.
Then all you have to is is put your cursor over any keyword and press F1.
You will soon see that libpath is not a keyword.
All other errors follow on from the first.
If you use win 10 you may have to activate the .chm by right clicking it, get properties and unchecking the little box.
Re: gtk +xml tutorial why not work?
Upps, right now I found out that you installed FB32bit. The tschoony link offers 64bit only -> incompatible.covid19 wrote:gtk 3 and gtk 2
wich version 32 or 64 ?
I found 32bit binaries for GTK-3.22.0 at (untested)
https://www.dropbox.com/sh/8d1qbh5dsp04 ... x-dwarf.7z
In long term, it'd be best that you either switch to 64 bit or build your own 32bit binaries.
Re: gtk +xml tutorial why not work?
i add
#LIBPATH "C:\opt\GTK3"
but now i have this
Command executed:
"C:\FreeBasic\fbc.exe" "C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas"
Compiler output:
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(24) error 42: Variable not declared, g_message in 'g_message("ClickButton clicked!")'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(33) error 42: Variable not declared, Ui_filename in 'IF 0 = gtk_builder_add_from_file(xml, Ui_filename, @mess) THEN'
Results:
Compilation failed
System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win32 (32bit)
OS: Windows NT 6.2 (build 9200)
#LIBPATH "C:\opt\GTK3"
but now i have this
Command executed:
"C:\FreeBasic\fbc.exe" "C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas"
Compiler output:
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(24) error 42: Variable not declared, g_message in 'g_message("ClickButton clicked!")'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(33) error 42: Variable not declared, Ui_filename in 'IF 0 = gtk_builder_add_from_file(xml, Ui_filename, @mess) THEN'
Results:
Compilation failed
System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win32 (32bit)
OS: Windows NT 6.2 (build 9200)
Re: gtk +xml tutorial why not work?
Yes, sorry for that mistake.dodicat wrote:libpath should be of the form
#LIBPATH "C:\opt\GTK3"
g_message() is a GLib macro. Uncomment the linecovid19 wrote:Compiler output:
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(24) error 42: Variable not declared, g_message in 'g_message("ClickButton clicked!")'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(33) error 42: Variable not declared, Ui_filename in 'IF 0 = gtk_builder_add_from_file(xml, Ui_filename, @mess) THEN'
Code: Select all
#INCLUDE ONCE "Gir/_GLibMacros-2.0.bi"
Code: Select all
'#DEFINE Ui_filename "GtkBuilder1.ui" ' simple 'Click me!' button
#DEFINE Ui_filename "GtkBuilder2.ui" ' complex UI with notebook
Re: gtk +xml tutorial why not work?
if uncomment this #DEFINE Ui_filename "GtkBuilder1.ui" ' simple 'Click me!' button
have this
Command executed:
"C:\FreeBasic\fbc.exe" "C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas"
Compiler output:
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgio-2.0
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgdk-3
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgtk-3
Results:
Compilation failed
System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win32 (32bit)
OS: Windows NT 6.2 (build 9200)
if uncomment this #DEFINE Ui_filename "GtkBuilder2.ui" ' complex UI with notebook
have this
Command executed:
"C:\FreeBasic\fbc.exe" "C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas"
Compiler output:
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgio-2.0
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgdk-3
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgtk-3
Results:
Compilation failed
System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win32 (32bit)
OS: Windows NT 6.2 (build 9200)
have this
Command executed:
"C:\FreeBasic\fbc.exe" "C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas"
Compiler output:
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgio-2.0
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgdk-3
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgtk-3
Results:
Compilation failed
System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win32 (32bit)
OS: Windows NT 6.2 (build 9200)
if uncomment this #DEFINE Ui_filename "GtkBuilder2.ui" ' complex UI with notebook
have this
Command executed:
"C:\FreeBasic\fbc.exe" "C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas"
Compiler output:
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgio-2.0
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgdk-3
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgtk-3
Results:
Compilation failed
System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win32 (32bit)
OS: Windows NT 6.2 (build 9200)
Re: gtk +xml tutorial why not work?
Fine, your code compiles now.covid19 wrote:Compiler output:
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgio-2.0
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgdk-3
C:\FreeBasic\bin\win32\ld.exe: cannot find -lgtk-3
The error messages are coming from the next step, linker (ld.exe) now. It cannot find the matching DLL files. Make sure that the #LIBPATH points to the right folder of libgio-2.0.dll, libgdk-3.dll and libgtk-3.dll (perhaps you have to rename the dll files: libgtk-3.0.dll -> libgtk-3.dll).
Re: gtk +xml tutorial why not work?
The image resolution is too low, I cannot read the text.
Note: I'm not a wodniws expert. AFAIR I never had .dll.a files (static libraries?). Instead the binaries I used years ago were .dll files (dynamic libraries?).
Sorry, at this point I cannot really help.
And: The Gir/Gtk-3.bi header is for Gtk-3.18.9. You should install that or a newer binary version. Perhaps you check the binaries I mentioned above:
https://www.dropbox.com/sh/8d1qbh5dsp04 ... x-dwarf.7z
Re: gtk +xml tutorial why not work?
ok dont worry i understund , is 2 day i try to see an example and i am not , first beginner in the world (thinking i am a sysadmin) , ahahahhaha
i am sorry but probably i will study another language
the comunity of free basic is very beautifull and i give my thankz at all for comprehension , but freebasic is very shi....... i think freebasic without this comunity probably will be stop develop many year ago .
immagine all tool for develop somthing , take gambas install it , instal some library and start to develop , QT install ambient e start to draw GUI and develop C++, visualstudio 2019 with VB or C# , the same.
i propose to change the name FreeBASIC to FreeAdvanced , only for graduated programmer not for beginner , and remove a Horse , and insert turtle
I hope this post will be read by the freebasic developers
P.S. i like the example of freebasic ahahahhahaha LOL ahahahahhahahahahaha
i am sorry but probably i will study another language
the comunity of free basic is very beautifull and i give my thankz at all for comprehension , but freebasic is very shi....... i think freebasic without this comunity probably will be stop develop many year ago .
immagine all tool for develop somthing , take gambas install it , instal some library and start to develop , QT install ambient e start to draw GUI and develop C++, visualstudio 2019 with VB or C# , the same.
i propose to change the name FreeBASIC to FreeAdvanced , only for graduated programmer not for beginner , and remove a Horse , and insert turtle
I hope this post will be read by the freebasic developers
P.S. i like the example of freebasic ahahahhahaha LOL ahahahahhahahahahaha
Re: gtk +xml tutorial why not work?
Of course. It uses GTK+ underlying so your app will look not any different than if you used GTK+ directly.covid19 wrote:i would create a crossplatform app iup work in linux ?? ....
-
- Posts: 782
- Joined: Jul 26, 2018 18:28
Re: gtk +xml tutorial why not work?
This code compiles without problems for me.
Four things are needed for this:
1) Compiler version: 1.07.1-win32
2) gtk2 lib in the folder \FreeBASIC-1.07.1-win32\lib\win32
Here I inserted gtk2 lib, which I downloaded through mingw32:
https://drive.google.com/file/d/1JGmUSO ... sp=sharing
3) Installing the gtk2 runtime: If you use Geany Windows, he can install it himself.
4) comment line 687 in \FreeBASIC-1.07.1-win32\lib\win32\inc\glib.bi
Subject on this issue: viewtopic.php?t=26931
Code: Select all
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< main program generated by utility GTK+tobac2 V2.2.0 >
'< Hauptprogramm erzeugt von >
'< Generated at / Generierung am 2010-09-06, 01:24 >
' ---------------------------------------------------------------------
'< Program info: >
CONST PROG_NAME = "Scribble" ' >
CONST PROG_DESC = "Zeichenprogramm" ' >
CONST PROG_VERS = "0.0" ' >
CONST PROG_YEAR = "2010" ' >
CONST PROG_AUTH = "TJF" ' >
CONST PROG_MAIL = "Thomas.Freiherr@gmx.net" ' >
CONST PROG_WEBS = "members.aon.at/tjf" ' >
'< >
'< Description / Beschreibung: >
'< Beispiel DrawArea, einfaches Zeichenprogramm >
'< >
'< License / Lizenz: >
'< >
'< Redistribution and use in source and binary forms, with or >
'< without modification, are permitted provided that the following >
'< conditions are met: >
'< >
'< * Redistributions of source code must retain the above >
'< copyright notice, this list of conditions and the following >
'< disclaimer. >
'< >
'< * Redistributions in binary form must reproduce the above >
'< copyright notice, this list of conditions and the following >
'< disclaimer in the documentation and/or other materials provided >
'< with the distribution. >
'< >
'< * Neither the name of the author nor the names of its >
'< contributors may be used to endorse or promote products derived >
'< from this software without specific prior written permission. >
'< >
'< THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS >
'< AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED >
'< WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES >
'< OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE >
'< ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER >
'< OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >
'< SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >
'< LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF >
'< USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED >
'< AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT >
'< LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN >
'< ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE >
'< POSSIBILITY OF SUCH DAMAGE. >
'< >
' ---------------------------------------------------------------------
'< Please prefer GNU GENERAL PUBLIC LICENSE to support open software. >
'< For more information please visit: http://www.fsf.org >
'< >
'< Bitte bevorzugen Sie die GNU GENERAL PUBLIC LICENSE und >
'< unterstuetzen Sie mit Ihrem Programm die freie Software >
'< Mehr Informationen finden Sie unter: http://www.fsf.org >
' ---------------------------------------------------------------------
'< GTK+tobac: general init / Allgemeine Initialisierungen >
' #INCLUDE "gtk/GTK-2.18.6_TJF.bi" ' GTK+library / GTK+ Bibliothek >
#include once "gtk/gtk.bi"
gtk_init(@__FB_ARGC__, @__FB_ARGV__) ' start GKT / GTK starten >
'< GTK+tobac: end block / Blockende >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
/' Backing pixmap for drawing area '/
DIM SHARED AS GdkPixmap PTR PIXMAP = NULL
DECLARE SUB draw_brush(BYVAL widget AS GtkWidget PTR, _
BYVAL x AS gdouble, _
BYVAL y AS gdouble)
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< _tobac.bas modul generated by utility GTK+tobac2 V2.2.0 >
'< Modul _tobac.bas erzeugt von >
'< Generated at / Generierung am 2010-09-06, 02:45 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
'IF gtk_check_version(2, 16, 0) THEN
' ?"Fehler/Error (GTK-Version): Version zu alt"
' END -1
'END IF
DIM AS STRING GUISTR
DIM SHARED AS GtkBuilder PTR XML
DIM SHARED AS GObject PTR _
WinScribble, Draw1, ButQuit
XML = gtk_builder_new()
SCOPE
DIM AS GError PTR meld
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< _gui.bas modul generated by utility GTK+tobac2 V2.2.0 >
'< Modul _gui.bas erzeugt von >
'< Generated at / Generierung am 2010-09-06, 02:45 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
GUIstr =_
"<?xml version=""1.0""?>"+_
"<interface>"+_
"<requires lib=""gtk+"" version=""2.16""/>"+_
"<!-- interface-naming-policy project-wide -->"+_
"<object class=""GtkWindow"" id=""WinScribble"">"+_
"<signal name=""destroy"" handler=""gtk_main_quit""/>"+_
"<child>"+_
"<object class=""GtkVBox"" id=""vbox1"">"+_
"<property name=""visible"">True</property>"+_
"<child>"+_
"<object class=""GtkDrawingArea"" id=""Draw1"">"+_
"<property name=""width_request"">200</property>"+_
"<property name=""height_request"">200</property>"+_
"<property name=""visible"">True</property>"+_
"<property name=""events"">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_STRUCTURE_MASK</property>"+_
"<signal name=""button_press_event"" handler=""on_Draw1_button_press_event""/>"+_
"<signal name=""motion_notify_event"" handler=""on_Draw1_motion_notify_event""/>"+_
"<signal name=""expose_event"" handler=""on_Draw1_expose_event""/>"+_
"<signal name=""configure_event"" handler=""on_Draw1_configure_event""/>"+_
"</object>"+_
"<packing>"+_
"<property name=""position"">0</property>"+_
"</packing>"+_
"</child>"+_
"<child>"+_
"<object class=""GtkButton"" id=""ButQuit"">"+_
"<property name=""label"" translatable=""yes"">Quit</property>"+_
"<property name=""visible"">True</property>"+_
"<property name=""can_focus"">True</property>"+_
"<property name=""receives_default"">True</property>"+_
"<signal name=""clicked"" handler=""gtk_main_quit""/>"+_
"</object>"+_
"<packing>"+_
"<property name=""expand"">False</property>"+_
"<property name=""fill"">False</property>"+_
"<property name=""position"">1</property>"+_
"</packing>"+_
"</child>"+_
"</object>"+_
"</child>"+_
"</object>"+_
"</interface>"
IF 0 = gtk_builder_add_from_string(XML, SADD(GUISTR), LEN(GUISTR), @meld) THEN
WITH *meld
?"Fehler/Error (GTK-Builder):"
?*.message
END WITH
END -1
END IF
END SCOPE
WinScribble = gtk_builder_get_object(XML, "WinScribble")
Draw1 = gtk_builder_get_object(XML, "Draw1")
ButQuit = gtk_builder_get_object(XML, "ButQuit")
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von >
'< Generated at / Generierung am 2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
FUNCTION on_Draw1_button_press_event CDECL ALIAS "on_Draw1_button_press_event" _
(BYVAL widget AS GtkWidget PTR, _
BYVAL event AS GdkEventButton PTR) AS gboolean EXPORT
IF event->button = 1 THEN IF PIXMAP THEN draw_brush(widget, event->x, event->y)
RETURN TRUE
END FUNCTION
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von >
'< Generated at / Generierung am 2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
FUNCTION on_Draw1_motion_notify_event CDECL ALIAS "on_Draw1_motion_notify_event" _
(BYVAL widget AS GtkWidget PTR, _
BYVAL event AS GdkEventMotion PTR) AS gboolean EXPORT
DIM AS INTEGER x, y
DIM AS GdkModifierType state
IF event->is_hint THEN
gdk_window_get_pointer(event->window, @x, @y, @state)
ELSE
x = event->x
y = event->y
state = event->state
END IF
IF state AND GDK_BUTTON1_MASK THEN IF PIXMAP THEN draw_brush(widget, x, y)
RETURN TRUE
END FUNCTION
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von >
'< Generated at / Generierung am 2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
FUNCTION on_Draw1_expose_event CDECL ALIAS "on_Draw1_expose_event" _
(BYVAL widget AS GtkWidget PTR, _
BYVAL event AS GdkEventExpose PTR) AS gboolean EXPORT
gdk_draw_drawable(widget->window, _
widget->style->fg_gc(gtk_widget_get_state(widget)), _
PIXMAP, _
event->area.x, event->area.y, _
event->area.x, event->area.y, _
event->area.width, event->area.height)
RETURN FALSE
END FUNCTION
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von >
'< Generated at / Generierung am 2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
FUNCTION on_Draw1_configure_event CDECL ALIAS "on_Draw1_configure_event" _
(BYVAL widget AS GtkWidget PTR, _
BYVAL event AS GdkEventConfigure PTR) AS gboolean EXPORT
IF PIXMAP THEN g_object_unref(pixmap)
PIXMAP = gdk_pixmap_new(widget->window, _
widget->allocation.width, _
widget->allocation.height, _
-1)
gdk_draw_rectangle(PIXMAP, _
widget->style->white_gc, _
TRUE, _
0, 0, _
widget->allocation.width, _
widget->allocation.height)
RETURN TRUE
END FUNCTION
SUB draw_brush(BYVAL widget AS GtkWidget PTR, _
BYVAL x AS gdouble, _
BYVAL y AS gdouble)
DIM AS GdkRectangle update_rect
update_rect.x = x - 5
update_rect.y = y - 5
update_rect.width = 10
update_rect.height = 10
gdk_draw_rectangle(PIXMAP, _
widget->style->black_gc, _
TRUE, _
update_rect.x, update_rect.y, _
update_rect.width, update_rect.height)
gtk_widget_queue_draw_area(widget, _
update_rect.x, update_rect.y, _
update_rect.width, update_rect.height)
END SUB
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< GTK+tobac: run GTK main, then end / GTK Hauptschleife, dann Ende >
gtk_builder_connect_signals(XML, 0) ' callbacks anbinden >
gtk_widget_show_all(GTK_WIDGET(WinScribble)) 'ptfenster darstellen >
gtk_main() ' main loop / Hauptschleife >
g_object_unref(XML) ' dereference / Referenz abbauen >
'< GTK+tobac: end block / Blockende >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
' you may unref files here / ggf. Dateien hier schliessen
END 0 ' finish with return code 0 / Ende mit Returncode 0
1) Compiler version: 1.07.1-win32
2) gtk2 lib in the folder \FreeBASIC-1.07.1-win32\lib\win32
Here I inserted gtk2 lib, which I downloaded through mingw32:
https://drive.google.com/file/d/1JGmUSO ... sp=sharing
3) Installing the gtk2 runtime: If you use Geany Windows, he can install it himself.
4) comment line 687 in \FreeBASIC-1.07.1-win32\lib\win32\inc\glib.bi
Code: Select all
Private Sub g_mutex_locker_free(ByVal locker As GMutexLocker Ptr)
'g_mutex_unlock(CPtr(GMutex Ptr, locker))
End Sub
Re: gtk +xml tutorial why not work?
Thanks for testing!
That download points to GTK-3.8.2 binaries.Xusinboy Bekchanov wrote:2) gtk2 lib in the folder \FreeBASIC-1.07.1-win32\lib\win32
Here I inserted gtk2 lib, which I downloaded through mingw32:
https://drive.google.com/file/d/1JGmUSO ... sp=sharing
I guess those are the binaries you compiled against.Xusinboy Bekchanov wrote:3) Installing the gtk2 runtime: If you use Geany Windows, he can install it himself.
It doesn't make sense to declare a private SUB in a header. You can remove all that stuff at the end of the official headers. Not just glib.bi, but also in gtk3.bi, gdk3.bi, ... It's coming from the fb-frog auto-translation. The Gir headers are free of that bload (less memory, compiling faster).Xusinboy Bekchanov wrote:4) comment line 687 in \FreeBASIC-1.07.1-win32\lib\win32\inc\glib.biSubject on this issue: viewtopic.php?t=26931Code: Select all
Private Sub g_mutex_locker_free(ByVal locker As GMutexLocker Ptr) 'g_mutex_unlock(CPtr(GMutex Ptr, locker)) End Sub
-
- Posts: 782
- Joined: Jul 26, 2018 18:28
Re: gtk +xml tutorial why not work?
But here there are gtk 2 libraries like libgtk-win32-2.0.dll.aTJF wrote:Thanks for testing!
That download points to GTK-3.8.2 binaries.Xusinboy Bekchanov wrote:2) gtk2 lib in the folder \FreeBASIC-1.07.1-win32\lib\win32
Here I inserted gtk2 lib, which I downloaded through mingw32:
https://drive.google.com/file/d/1JGmUSO ... sp=sharing
I downloaded and installed the runtime library from here (version 2.24)TJF wrote:I guess those are the binaries you compiled against.Xusinboy Bekchanov wrote:3) Installing the gtk2 runtime: If you use Geany Windows, he can install it himself.
https://sourceforge.net/projects/gtk-wi ... vironment/
I just checked with the headers of the official FreeBasic build (1.07.1).TJF wrote:It doesn't make sense to declare a private SUB in a header. You can remove all that stuff at the end of the official headers. Not just glib.bi, but also in gtk3.bi, gdk3.bi, ... It's coming from the fb-frog auto-translation. The Gir headers are free of that bload (less memory, compiling faster).Xusinboy Bekchanov wrote:4) comment line 687 in \FreeBASIC-1.07.1-win32\lib\win32\inc\glib.biSubject on this issue: viewtopic.php?t=26931Code: Select all
Private Sub g_mutex_locker_free(ByVal locker As GMutexLocker Ptr) 'g_mutex_unlock(CPtr(GMutex Ptr, locker)) End Sub