Glade2PB (0.6.1) now with Cross-Plattform support :-)

Developed or developing a new product in PureBasic? Tell the world about it.
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Glade2PB (0.6.1) now with Cross-Plattform support :-)

Post by walker »

Hi,

unfortunately I have not the amount of time at present to do all things I want to do... this is mainly caused due to my longtime illness... and that's the reason for my longer absence here too..
I'd stopped this project since november 2006.. but will continue as soon as possible... I decided to release it the current state because it's maybe usefull for someone...

(the old version can be fond here ...
http://www.purebasic.fr/english/viewtop ... t=glade2pb
... just a reminder)

The new version is able to create PB4 compatible code which can be used on Linux, Windows and (I hope so) on MacOs (PB v4 released of course) without a change...

A new preview function is added so you can see how the generated code looks like with GTK Widgets or PB Gadgets

Some screenies:
Image

Image

Image

Supported PB-Gadgets so far (PB-Gadget is in the first column):

Code: Select all

Window			Window 			-> gtk_window_new_
ButtonGadget		Button 			-> gtk_button_new_from_stock_, gtk_button_new_ 
ButtonGadget 		ToggleButton 		-> gtk_toggle_button_new_, gtk_toggle_button_new_with_mnemonic_, gtk_toggle_button_new_with_label_
ImageGadget		Image 			-> gtk_image_new_from_stock_
TextGadget		Label 			-> gtk_label_new_with_mnemonic_, gtk_label_new_
EditorGadget		TextView 			-> gtk_text_view_new_
StringGadget		Entry 			-> gtk_entry_new_
CheckBoxGadget	Checkbutton 		-> gtk_check_button_new_with_mnemonic_, gtk_check_button_new_
OptionGadget		RadioButton 		-> gtk_radio_button_new_with_mnemonic_, gtk_radio_button_new_
TreeGadget		Treeview 			-> gtk_tree_view_new_
ComboBoxGadget	Combobox 		-> gtk_combo_box_new_text_, gtk_combo_box_new_
ComboBoxGadget	Comboboxentry 	->gtk_combo_box_entry_new_text, gtk_combo_box_entry_new_
StatusBar		Statusbar 		-> gtk_statusbar_new_
(the second column is the gtk widgetname and the 3rd is the appropriate gtk command)

If you choose to generate the PB v4 compatible source, you cannot decide (yet) which of the files you want to generate... AND you MUST have useed a fixed Widget in Glade.... else you'll get an error message... This is essential for the code generation as else NO x and y coordinates are used by glade.. (yes, you can design a gtk based application without any x and y parms... great isn't it?) but PB do need them!
Simply have a look at the src folder in the Glade Project folder to locate the generated source... the prefix is pb_ for the V4-source code
The files declare.pb and callbacs.pb are identical for both versions of the source... the different files are main.pb and pb_main.pb , interface.pb and pb_interface.pb
A word to the event loop: I'd taken this from a source ... I guess it's generated by Berico's VD , but not sure...

At least here the link: http://home.arcor.de/x-linux/pure/g2pb

suggestions and comments are welcome

Edit 15.08.2007
updated to v 0.62
added - source can be load into the IDE by one click
some bug fixes
some missing constants added
klaver
Enthusiast
Enthusiast
Posts: 147
Joined: Wed Jun 28, 2006 6:55 pm
Location: Schröttersburg

Re: Glade2PB (0.6.1) now with Cross-Plattform support :-)

Post by klaver »

Can't get it to work. On the beginning I couldn't generate the C code in glade-gnome-3 as it's not doing it anymore (wtf?).
Installed glade-gnome-2 then, built the source code. Selecting the path in glade2pb preferences where I saved the .glade (there are many files as AUTHORS, README, NEWS, autogen.sh, configure.in, etc).
In the combobox ("Please choose a Project") I have "po" and "src", tried to select both with no luck.

Convert gives no errors, but also doesn't do ANYTHING. Same for preview. With "PB - commandset" checkbox selected I get:

Code: Select all

Please generate the project first!

Code: Select all

NO fixed widget found!
Can't continue generating Sources with PB commands...

(though the sources with GTK2 commands has been generated)
"though the sources with GTK2 commands has been generated" is also not true as NOTHING is generated at all.
Image
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Re: Glade2PB (0.6.1) now with Cross-Plattform support :-)

Post by walker »

Hi,

first glade2pb only "supports" glade 2 ... unfortunately the code generation is removed in glade 3 (maybe I''ll write something for glade 3....)

do the following steps (step 3 and 5 are important... don't forget them!):

1: install glade 2 and all dependencies ..
2. start glade and set a projectpath in preferences to store your projects (i.e: /home/yourname/projects) and set the language t C
3. create a window with some widgets BUT do not forget to add a fixed widget before adding any other widget to the window!!!!
4. save the project (if you leave the predefined name, it will be named Project1; a folder in your projectpath is created with this name and some files and subfolders ... but don't look at them ...)
5. IMPORTANT : generate the c-code from within glade! (some more files are generated ...)
6. start glade2pb and set the project path in preferences (/home/yourname/projects)
7. press refresh
8. select the project previously saved (and generated) with glade from the dropdown
8a. If you want, you can choose preview (GTK+ style should work always) to have a preview
9. press convert
10.leave the options as defined and press convert
11. done (if no error occurs) 8)

The pb source files are located in /home/yourname/projects/Projekt1/src/
but you can select the project and choose Edit from the toolbar to launch the main source file in the Purebasic-IDE
if something is not clear on some points .. don't panic :wink: ask and I'll try to answer all questions
klaver
Enthusiast
Enthusiast
Posts: 147
Joined: Wed Jun 28, 2006 6:55 pm
Location: Schröttersburg

Re: Glade2PB (0.6.1) now with Cross-Plattform support :-)

Post by klaver »

Thanks! Working great, just didn't know that project files must be in sub-directory of the specified folder.
Image
Post Reply