GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to attach custom glade in gtk?

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
Saniat
Familiar Face


Joined: 24 Dec 2009
Posts: 23

PostPosted: Tue Mar 16, 2010 4:40 am    Post subject: how to attach custom glade in gtk? Reply with quote

Hi
i create a custom widget name:textView.now i want to put this in glade.i make a textView.xml in /usr/share/glade3/catalogs/ location
Code: (XML/HTML)
1
2
3
4
5
6
7
8
9
<?xml version="1.0" encoding="UTF-8"?>
<glade-catalog name="textView" library="textView" depends="gtk+" domain="glade3">
    <glade-widget-classes>
        <glade-widget-class
name="EadsTextViewEditable" generic-name="textView" title="Eads Text View" />
    </glade-widget-classes>
    <glade-widget-group
name="TextView-widgets" title="Eads Text View Widgets">
        <glade-widget-class-ref
name="EadsTextViewEditable"/>
    </glade-widget-group>
</glade-catalog>

and another so file libtextView.so in /usr/lib/glade3/modules/
the make file is:
all: textView

Code: (Plaintext)
1
2
3
4
5
6
7
8
9
10
11
textView: main.o libtextView.so
    gcc -g -rdynamic -o textView `pkg-config --libs gtk+-2.0` $^

main.o: main.c eads_text_view_editable.h
    gcc -g -c `pkg-config --cflags gtk+-2.0` $<

libtextView.so: eads_text_view_editable.o
    gcc -g -shared -o libtextView.so `pkg-config --libs gtk+-2.0` $^

eads_text_view_editable.o: eads_text_view_editable.c eads_text_view_editable.h
    gcc -fpic -g -c `pkg-config --cflags gtk+-2.0` $<

after build and run my project i get this msg:
Code: (Plaintext)
1
2
3
4
5
6
root: (bar:com.example.apps.simplegladeapp:1334) libglade-WARNING: Could not load
support for `textView': libtextView.so: cannot open shared object file:
No such file or directory

root: (bar:com.example.apps.simplegladeapp:1334) libglade-WARNING:
unknown widget class 'EadsTextViewEditable'



Where i did wrong?

Thnx in advance.

Saniat
Back to top
Saniat
Familiar Face


Joined: 24 Dec 2009
Posts: 23

PostPosted: Tue Mar 16, 2010 10:29 am    Post subject: Reply with quote

Any ideas at all? Please don't ignore this thread! :(
Back to top
tadeboro
Never Seen the Sunlight


Joined: 23 Jul 2008
Posts: 2114
Location: Slovenia

PostPosted: Tue Mar 16, 2010 11:39 am    Post subject: Reply with quote

Hello.

I think you'll need to place your shared library into some folder where linker will be able to find it at runtime (like /usr/lib). /usr/lib/glade/modules is not meant to be used as a location for your libraries, catalog supporting modules should be placed here (and if you don't need any special handling, then you probably don't need anything here).

Tadej
Back to top
Saniat
Familiar Face


Joined: 24 Dec 2009
Posts: 23

PostPosted: Tue Mar 16, 2010 11:57 am    Post subject: Reply with quote

Thnx for the reply.

according to your suggestion i copy my .so library in /usr/lib and i think it gets the library cos the error is change
now the error is:

Code: (Plaintext)
1
2
3
4
libglade-WARNING: could not find `textView' init function:
`glade_module_register_widgets': /usr/lib/libtextView.so: undefined symbol:
 glade_module_register_widgets

did i make any wrong in my source file?

thanks in advance.
Back to top
tadeboro
Never Seen the Sunlight


Joined: 23 Jul 2008
Posts: 2114
Location: Slovenia

PostPosted: Tue Mar 16, 2010 1:13 pm    Post subject: Reply with quote

Hi.

What project format and builder are you using? Custom widget insertions differ between libglade and GtkBuilder methods.

Tadej
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP