LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-09-2018, 01:20 PM   #1
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro / Parrot
Posts: 6,916

Rep: Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396
dockapp, gtk updating dockapp to gtk2 or gtk3


I got this one dockapp that is not behaving absolutely the way I believe it should. it is called "minicontrol" that shows the then and two buttons one for WPref the other is to display a ShutDown,restart,cancel message box window.

When the second button is pressed to shutdown, or reboot. that window and another window gets displayed. the second window that shows up is like another dockapp and takes its place in the dockapp area. Which is no big deal if one is shutting down or rebooting, because it will go away along with the entire desktop.


BUT, if cancel is selected that is when I get upset. The extra dockapp window that shows up with the message selection box window, (or whatever it is called) does not go away.

this is the sniplet of code that fires off the box and how it deals with the cancle button part.

Code:
	gtk_signal_connect (GTK_OBJECT(button3), "clicked", GTK_SIGNAL_FUNC(exitwidget), dialog);
	
	gtk_container_add (GTK_CONTAINER (dialog), table);
	gtk_widget_show_all (dialog);
   return;


} // end launchdialog

void exitwidget (GtkWidget *wgt, gpointer data){
	gtk_widget_destroy (GTK_WIDGET(data));
	return;
} // end exitwidget
this is gtk 1

as I have been googling around looking for a way to fix it. Seeing that it is
Code:
gtk_signal_connect is deprecated and should not be used in newly-written code.
with no use this instead to take its place, and the simple fact this is Slackware 41.2 I am using I am putting this in Slackware, and not programming.

Because if I take on this task, I thought to just fix that one thing, why not just updated the entire file which is only approx 400 lines of code. so it complies and works with the gtk that is being used today.

Code:
$ whereis gtk-3.0
gtk-3: /usr/lib64/gtk-3.0 /etc/gtk-3.0 /usr/include/gtk-3.0 /usr/share/gtk-3.0
userx@slackwhere101:~/Documents/minicontrol
$ whereis gtk-2.0
gtk-2: /usr/lib64/gtk-2.0 /etc/gtk-2.0 /usr/include/gtk-2.0 /usr/share/gtk-2.0
make file that came with it updated to reflect 2.0 or 3.0.

Code:
#LIBCONFIG = `gtk-config  --cflags --libs`
LIBCONFIG = `pkg-config --cflags --libs gtk+-3.0`
c file replaced
Code:
/*
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
*/
#include <gtk-2.0/gtk.h>
#include <gdk-2.0/gdk.h>
#include <gdk-2.0/gdkx.h>
2.0 or 3.0 does not matter I keep getting that same Ole error.
Code:
$ make
gcc -g -Wall -D__CONFPATH='"/usr/local/share/minicontrol"' -D__CONFFILE='"minicontrol.cf"' `pkg-config --cflags --libs gtk+-2.0` -o minicontrol minicontrol.c
minicontrol.c:19:25: fatal error: gtk-2.0/gtk.h: No such file or directory
compilation terminated.
makefile:28: recipe for target 'minicontrol' failed
make: *** [minicontrol] Error 1
-----
$ make
gcc -g -Wall -D__CONFPATH='"/usr/local/share/minicontrol"' -D__CONFFILE='"minicontrol.cf"' `pkg-config --cflags --libs gtk+-3.0` -o minicontrol minicontrol.c
minicontrol.c:19:25: fatal error: gtk-3.0/gtk.h: No such file or directory
compilation terminated.
makefile:28: recipe for target 'minicontrol' failed
make: *** [minicontrol] Error 1
so after all of that, how do I get that to work?

Last edited by BW-userx; 03-09-2018 at 01:21 PM.
 
Old 03-09-2018, 01:36 PM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
Code:
pkg-config --cflags gtk+-2.0
-pthread -I/usr/include/gtk-2.0 ...
Using locate to find /gtk.h...
Code:
...
/usr/include/gtk-3.0/gtk/gtk.h
...
/usr/include/gtk-2.0/gtk/gtk.h
...
So change code to:
Code:
#include <gtk/gtk.h>
...
 
1 members found this post helpful.
Old 03-09-2018, 02:04 PM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro / Parrot
Posts: 6,916

Original Poster
Rep: Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396
Quote:
Originally Posted by keefaz View Post
Code:
pkg-config --cflags gtk+-2.0
-pthread -I/usr/include/gtk-2.0 ...
Using locate to find /gtk.h...
Code:
...
/usr/include/gtk-3.0/gtk/gtk.h
...
/usr/include/gtk-2.0/gtk/gtk.h
...
So change code to:
Code:
#include <gtk/gtk.h>
...
SO the header file define in the code stays gtk , in there lays my error.
thanks. Let me give that a try.
 
Old 03-09-2018, 02:11 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro / Parrot
Posts: 6,916

Original Poster
Rep: Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396
well it got rid of that where is it error,
Code:
/usr/lib64/gcc/x86_64-slackware-linux/5.5.0/../../../../x86_64-slackware-linux/bin/ld: /tmp/ccmxkEpS.o: undefined reference to symbol 'XSetCommand'
/usr/lib64/../lib64/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
makefile:28: recipe for target 'minicontrol' failed
make: *** [minicontrol] Error 1
thanks, now i got something I can work with,...
 
Old 03-09-2018, 02:44 PM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
Maybe add -lX11 to gcc options (before pkg-config gtk...)
or ' pkg-config --libs x11 ' but it's same thing

Last edited by keefaz; 03-09-2018 at 02:46 PM.
 
1 members found this post helpful.
Old 03-09-2018, 02:52 PM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro / Parrot
Posts: 6,916

Original Poster
Rep: Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396
Quote:
Originally Posted by keefaz View Post
Maybe add -lX11 to gcc options (before pkg-config gtk...)
or ' pkg-config --libs x11 ' but it's same thing
thanks!

as it stands it should be all the gtk gdk functions are obsolete or deprecated so it should keep failing until I get all of the new functions and whatever else gtk updated in the code before it works again.

Last edited by BW-userx; 03-09-2018 at 02:55 PM.
 
Old 03-09-2018, 03:01 PM   #7
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
If there is a linking error again, add -lX11 after ' pkg-config --cflags --libs gtk+-2.0 ' at gcc command line
I wrongly suggested the opposite in previous post
 
Old 03-09-2018, 03:11 PM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro / Parrot
Posts: 6,916

Original Poster
Rep: Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396Reputation: 1396
Quote:
Originally Posted by keefaz View Post
If there is a linking error again, add -lX11 after ' pkg-config --cflags --libs gtk+-2.0 ' at gcc command line
I wrongly suggested the opposite in previous post
figured it out, thanks again.
Code:
DEFINE = -D__CONFPATH='"$(CONFIGPATH)"' -D__CONFFILE='"$(CONFIGFILE)"'
LDLIBS += -lX11

#LIBCONFIG = `gtk-config  --cflags --libs`
LIBCONFIG = `pkg-config --cflags --libs gtk+-2.0`


$(BIN) : $(SRC)
	gcc $(CFLAGS) $(DEFINE) $(LDLIBS) $(LIBCONFIG) -o $(BIN) $(SRC)
gets
Code:
userx@slackwhere101:~/Documents/minicontrol
$ make
gcc -g -Wall -D__CONFPATH='"/usr/local/share/minicontrol"' -D__CONFFILE='"minicontrol.cf"' -lX11 `pkg-config --cflags --libs gtk+-2.0` -o minicontrol minicontrol.c
minicontrol.c: In function 'parse_from_config':
minicontrol.c:280:9: warning: variable 'c' set but not used [-Wunused-but-set-variable]
     int c;
equals a good build. Just need to update the code to get rid of the funny results I'm now getting when executing it.

Last edited by BW-userx; 03-09-2018 at 03:12 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Build Spice-Gtk-0.6 (GTK2 & GTK3) on Ubuntu 11.10 (Oneiric) LXer Syndicated Linux News 0 06-28-2011 11:51 AM
How to Get DockApp under Fluxbox Windows?? nedson Linux - Software 1 01-15-2005 08:28 PM
Install DOCKAPP in WindowMaker SML Linux - Newbie 3 03-13-2004 07:03 AM
How does fluxbox know a dockapp is a dockapp? Cerbere Linux - Software 1 11-12-2003 05:38 AM
Dockapp questions e1000 Linux - Software 1 11-04-2003 11:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration