1. EuGTK - documentation?

EuGTK for Euphoria v. 4.0 needs documentation. All it has now is demos and *.e files. I can figure out a few things from the demos but it's rough going.

new topic     » topic index » view message » categorize

2. Re: EuGTK - documentation?

Pretty much not going to happen, too much work, too few users.

The only recommendation I have is to study the gtk.org on-line reference to see how many and what type parameters need to be passed when creating, setting, or getting control values. That's what I do.

One thing to note when doing this: many GTK widgets have shortcut ways to create them, for example, we'll use the GtkEntry (single-line text entry). From the GTK docs, you'll see:

GtkWidget* gtk_entry_new (void);  
GtkWidget* gtk_entry_new_with_buffer (GtkEntryBuffer *buffer);  
GtkWidget* gtk_entry_new_with_max_length (gint max); 
 

The 2nd and 3rd line are so-called 'convenience' functions that allow setting some params while creating the control. Ignore them. I don't implement them, they aren't necessary. Just set whatever you need after the control is created.

The only widgets which are really difficult to use are the list_view and tree_view widgets. http://www.dreamincode.net/forums/topic/169010-linux-working-with-gtk-list-boxes/ may help. (you can compare this with test33.ex in the EuGTK demos)

With minor variations, you can use PyGTK or php-gtk tutorials as well. And converting from C programs can be done pretty much on a line-by-line basis. Just leave out all the type-casting.

new topic     » goto parent     » topic index » view message » categorize

3. Re: EuGTK - documentation?

irv said...

Pretty much not going to happen, too much work, too few users.

Disappointing. Sounds like maybe a dead project. The reason why I got interested in EuGTK is that programs based on EuGTK don't require a *.so file. WxEuphoria is great and has everything in it but some people have a problem installing the *.so file. That's the one and only problem I have with wxEuphoria.

About "too few users". That could be a catch 22 situation. No users, no motivation to write documentation. No documentation, very difficult to use it.

new topic     » goto parent     » topic index » view message » categorize

4. Re: EuGTK - documentation?

OK, let's say I were to find the time to write docs. What would you have me document? What are you having trouble with?

new topic     » goto parent     » topic index » view message » categorize

5. Re: EuGTK - documentation?

irv said...

OK, let's say I were to find the time to write docs. What would you have me document? What are you having trouble with?

Currently I'm trying to translate my program DMAK (Diet Monger Ass Kicker) from wxEuphoria to EuGTK. I managed to slog my way up to what in wxEuphoria is called wxListCtrl. In EuGTK in test35.e it's called GtkTreeView. At that point I said to myself: I guess this this is a dead project, at least until I get some documentation.

new topic     » goto parent     » topic index » view message » categorize

6. Re: EuGTK - documentation?

There is no longer any GTK list view - only the tree view, which serves for either purpose, depending upon whether you load it using a list_store model, or a tree_store model.

Here are a few places which document this model/view/controller stuff:

http://zetcode.com/tutorials/gtktutorial/gtktreeview/
http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-treeview-components
http://scentric.net/tutorial/ch-treeview.html
http://gtk.php.net/manual/en/tutorials.treeview.php
http://library.gnome.org/devel/gtkmm-tutorial/unstable/chapter-treeview.html

If you need to use the TreeView instead of the plain List View, I'll work up a small demo of that.

new topic     » goto parent     » topic index » view message » categorize

7. Re: EuGTK - documentation?

OK, here you go - you can see a screenshot here Note: you'll need an updated EuGTK library ver. 4.1.8 - download it here

 
include GtkEngine.e 
 
include file.e 
include std/sequence.e 
include std/filesys.e 
include std/machine.e 
 
 
function Foo(object selected) 
	Info(0,"You Chose",get(selected,"text"),repeat('*',20)) 
	return 1 
end function 
constant foo = call_back(routine_id("Foo")) 
 
constant win = create(GtkWindow) 
	connect(win,"destroy",quit) 
	set(win,"title","Tree View") 
	set(win,"position",GTK_WIN_POS_CENTER) 
	set(win,"border width",10) 
	set(win,"default size",400,400) 
 
constant panel = create(GtkVBox) 
	add(win,panel) 
 
constant iv  = create(GtkTreeView) 
	set(iv,"reorderable",TRUE) 
	add(panel,iv) 
	 
constant lbl = create(GtkLabel) 
set(lbl,"markup", 
	"<span size='small'>Double click on a row to retrieve info\nDrag items to re-order!</span>") 
pack(panel,-lbl) 
 
atom renderer1 = create(GtkCellRendererText) 
constant col0 = create(GtkTreeViewColumn) 
 
object store = create(GtkTreeStore,gSTR,gSTR)  
	set(iv,"model",store) 
	set(iv,"insert column with attributes",-1,"Name",renderer1,"text",0) 
	set(iv,"insert column with attributes",-1,"Difficulty",renderer1,"text",1) 
 
enum COL0 = 0, COL1, COL2 
 
object parent = allocate(32) 
object child = allocate(32)  
 
procedure new_category(atom store, object txt) 
	set(store,"append",parent) 
	for col = 1 to length(txt) do 
		set(store,"set",parent,col-1,allocate_string(txt[col]),-1) 
	end for 
end procedure 
 
procedure new_row(atom store, object txt) 
	set(store,"append",child,parent) 
	for col =  1 to length(txt) do 
		set(store,"set",child,col-1,allocate_string(txt[col]),-1) 
	end for 
end procedure 
 
new_category(store,{"Programming Languages"}) 
	new_row(store,{"Euphoria","Easy"}) 
	new_row(store,{"Python","Easy"}) 
	new_row(store,{"C++","Difficult"}) 
	new_row(store,{"C","Dangerous"}) 
	 
new_category(store,{"Operating Systems"}) 
	new_row(store,{"Windows","fragile"}) 
	new_row(store,{"Linux","Much better"}) 
	new_row(store,{"OSX","Costly"}) 
 
connect(iv,"row-activated",foo,child) 
 
show_all(win) 
main() 
 
new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu