Learning GtkDialog (hopefully) -- and I have questions...
Learning GtkDialog (hopefully) -- and I have questions...
Let me start by saying that programming is not a strength of mine! I have a hard time with this stuff... but I'm determined
The ultimate goal here is to create an LXLauncher style "netbook interface" for Puppy, using GtkDialog... I realize that I'm well away from achieving that, but I'd like to see how far I can get.
Eventually what I want is for this interface to sit on top of JWM, replacing the bottom tray. The interface will have tabs...
Home
Filesystem
Graphics
Internet
Productivity
Entertainment
Utility
Config
More specifically... Internet also contains the "Network" submenu; Productivity combines Document, Business, and Personal; Entertainment combines (most of) Multimedia and Fun; CD burning tools and the like are (if possible) merged into Utility, and Config incorporates Desktop, System, and Setup.
"Home" is a special tab which contains quick links to commonly needed items -- it serves as the desktop, if you will. It links to the ConnectWizard, defaultbrowser, defaultwordprocessor, and rxvt (Terminal), as well as showing the currently-available drives and partitions (sda1,sda2,sdb1,sr0,etc). The drive icons hot-update lets say every five seconds (this can very easily change -- but they must update without restarting JWM or X).
Program icons displayed within the interface's tabs should change the same way that the JWM PuppyMenu changes -- running "fixmenus" in a terminal should update things.
*ahem*
So the first question is --
I want the interface to be fullscreen, with no titlebar and no frame/border around the window. I know that I want to use a GtkNotebook widget as the primary component -- that widget will implement the tabs and contain the icons.
What I don't know is how to actually /do/ that. I have an idea but I don't know if it's permissible... basically, embed a widget inside another widget. In this case, create a GtkWindow that has no 'decorations' (titlebar,frame/border,etc) and is fullscreen, and then stick the GtkNotebook inside the GtkWindow.
Can I do that? and in either case, is there a better way?
The ultimate goal here is to create an LXLauncher style "netbook interface" for Puppy, using GtkDialog... I realize that I'm well away from achieving that, but I'd like to see how far I can get.
Eventually what I want is for this interface to sit on top of JWM, replacing the bottom tray. The interface will have tabs...
Home
Filesystem
Graphics
Internet
Productivity
Entertainment
Utility
Config
More specifically... Internet also contains the "Network" submenu; Productivity combines Document, Business, and Personal; Entertainment combines (most of) Multimedia and Fun; CD burning tools and the like are (if possible) merged into Utility, and Config incorporates Desktop, System, and Setup.
"Home" is a special tab which contains quick links to commonly needed items -- it serves as the desktop, if you will. It links to the ConnectWizard, defaultbrowser, defaultwordprocessor, and rxvt (Terminal), as well as showing the currently-available drives and partitions (sda1,sda2,sdb1,sr0,etc). The drive icons hot-update lets say every five seconds (this can very easily change -- but they must update without restarting JWM or X).
Program icons displayed within the interface's tabs should change the same way that the JWM PuppyMenu changes -- running "fixmenus" in a terminal should update things.
*ahem*
So the first question is --
I want the interface to be fullscreen, with no titlebar and no frame/border around the window. I know that I want to use a GtkNotebook widget as the primary component -- that widget will implement the tabs and contain the icons.
What I don't know is how to actually /do/ that. I have an idea but I don't know if it's permissible... basically, embed a widget inside another widget. In this case, create a GtkWindow that has no 'decorations' (titlebar,frame/border,etc) and is fullscreen, and then stick the GtkNotebook inside the GtkWindow.
Can I do that? and in either case, is there a better way?
I still need a WM of some sort -- after all, the launcher I'm (hopefully) making is only a launcher, and not a WM itself. It could be one of the 'trayless' WMs (IIRC OpenBox is like that) but I do need a WM.
What I'm wanting is basically LXLauncher, but configurable in meaningful ways. (IIRC LXLauncher was basically abandoned mid-development.)
EDIT: to be more clear -- the 'notebook' widget in GtkDialog is what I'm wanting to be fullscreen and undecorated -- and the only thing that I want that way. That's the launcher. Anything it launches needs to have the decorations -- title bar, min/max/close buttons, and window frame/border -- the works.
What I'm wanting is basically LXLauncher, but configurable in meaningful ways. (IIRC LXLauncher was basically abandoned mid-development.)
EDIT: to be more clear -- the 'notebook' widget in GtkDialog is what I'm wanting to be fullscreen and undecorated -- and the only thing that I want that way. That's the launcher. Anything it launches needs to have the decorations -- title bar, min/max/close buttons, and window frame/border -- the works.
Re: Learning GtkDialog (hopefully) -- and I have questions...
Do this in your /root/.jwm/jwm-personal, to give the option to disable that stuff to any app:I want the interface to be fullscreen, with no titlebar and no frame/border around the window.
<Group>
<Class>my_classname</Class>
<Option>noborder</Option>
<Option>notitle</Option>
</Group>
(... note... gtkdialog also can use 'decorated="false"' (see below) ... )
Then you need to force your GUI to fill the screen... So use xwininfo to get the screen height and width:
Code: Select all
export WIDTH=`xwininfo -root | grep Width | cut -f2 -d':' `
export HEIGHT=`xwininfo -root | grep Height | cut -f2 -d':' `
Then in the top of your gtkdialog GUI you can add this (height and width are reduced a little from actual screen size, and decorated=false hides the window title etc):
Code: Select all
export GUI='<window height-request="'$((HEIGHT-25))'" width-request="'$((WIDTH-25))'" decorated="false">
... blah ...
</window>'
Then at the end of the script, when you load up the GUI and run gtkdialog, add this class stuff at the end:
Code: Select all
gtkdialog --program MYGUI --class=my_classname
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]
That's definitely useful. I think that will answer that question.
Next: this is a kinda basic one that the documents online don't go into. I've looked, and they just don't explain.
How do I do the beginning part of the GtkDialog script, so that it will open the GtkNotebook with the proper tabs and such, and then populate it with icons?
Next: this is a kinda basic one that the documents online don't go into. I've looked, and they just don't explain.
How do I do the beginning part of the GtkDialog script, so that it will open the GtkNotebook with the proper tabs and such, and then populate it with icons?
Gtkdialog needs a string passed to it, and that *is* the GUI - it doesnt need to be populated or manipulated after creating it - it just needs to be executed by gtkdialog...
The easiest way to do it (IMHO) is something like this:
The easiest way to do it (IMHO) is something like this:
Code: Select all
#!/bin/sh
#set some variables ... just as examples of how to customise the GUI before it loads
export mytitle="My program name"
export version=0.1
export tab=1 #will load the 2nd tab, the 1st tab is zero
export button_label_1="Click Me!"
export button_label_2="Click Me Too!"
export WIDTH=300
# create the GUI string ..
export MY_GUI_STRING='<window title="'$mytitle' '$version'" width-request="'$WIDTH'">
<vbox>
<notebook labels="first|second" page="'$tab'">
<frame>
<text><label>"first tab"</label></text>
<button>
<label>'$button_label_1'</label>
<input file>/usr/local/lib/X11/pixmaps/draw24.png</input>
</button>
</frame>
<frame>
<text><label>"second tab"</label></text>
<button>
<label>'$button_label_2'</label>
<input file stock="gtk-execute"></input>
</button>
</frame>
</notebook>
<button cancel></button>
</vbox>
</window>'
#run gtkdialog, using the GUI string above
gtkdialog --program MY_GUI_STRING
#gui is now closed
exit 0
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]
There are possibly better ways, but this is how I would do it:
Code: Select all
#!/bin/sh
#set some variables ... just as examples of how to customise the GUI before it loads
export mytitle="My program name"
export version=0.1
export tab=1 #will load the 2nd tab, the 1st tab is zero
export button_label_1="Seamonkey Composer"
export button_label_2="Abiword"
export button_label_3="MtPaint"
export WIDTH=500
# create the GUI string ..
export MY_GUI_STRING='<window title="'$mytitle' '$version'" width-request="'$WIDTH'">
<vbox>
<notebook labels="Document|Graphic" page="'$tab'">
<frame>
<text use-markup="true"><label>"<b>Document</b>"</label></text>
<button>
<label>'$button_label_1'</label>
<input file>/usr/local/lib/X11/pixmaps/www24.png</input>
<action>/usr/local/bin/defaulthtmleditor</action>
</button>
<button height-request="30" width-request="30">
<label>'$button_label_2'</label>
<input file>/usr/local/lib/X11/pixmaps/word24.png</input>
<action>/usr/bin/abiword</action>
</button>
</frame>
<frame>
<text use-markup="true"><label>"<b>Graphic</b>"</label></text>
<button>
<label>'$button_label_3'</label>
<input file>/usr/local/lib/X11/pixmaps/paint24.png</input>
<action>/usr/bin/mtpaint</action>
</button>
</frame>
</notebook>
<hbox homogeneous="true">
<button cancel></button>
</hbox>
</vbox>
</window>'
#run gtkdialog, using the GUI string above
gtkdialog --program MY_GUI_STRING
#gui is now closed
exit 0
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
Yes, but that hard-codes the applications in... with no easy way to change them. I want 'dynamic' loading of the applications -- the same way that the PuppyMenu works -- something (be it the *.menu files or a set of custom shell scripts) polls the *.desktop files and updates the icons in the launcher.
Would be really nifty to have proper icons that can be double-clicked, but that will wait till later...
Would be really nifty to have proper icons that can be double-clicked, but that will wait till later...
Maybe these two examples will give any clue?
Remove the '.gz' extension and make executable.
Remove the '.gz' extension and make executable.
- Attachments
-
- apps-in-Xdialog.gz
- Remove the '.gz' extension
- (1.87 KiB) Downloaded 212 times
-
- apps-in-gtkdialog.gz
- Remove the '.gz' extension
- (4.15 KiB) Downloaded 223 times
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
Brilliant, RHS!
(as usual..)
Wouldn't the gtk menu widget be a better option for starhawk's goal than the notebook widget?
Just thinking out loud
(as usual..)
Wouldn't the gtk menu widget be a better option for starhawk's goal than the notebook widget?
Just thinking out loud
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
OK, prototype script attached... let me know what I did wrong
- Attachments
-
- launcher-refresh.sh.gz
- fake *.gz -- remove extension; do not use gunzip...
- (7.34 KiB) Downloaded 183 times
Program Launcher
starhawk,
Technosaurus made a quick parsing utility for Desktop files which I've modified and added an icon finder that you may wish to use. The rest of the program categories could be added for each notebook.
Probably needs work to get the icons lined up nicely.
Cheers,
s
Technosaurus made a quick parsing utility for Desktop files which I've modified and added an icon finder that you may wish to use. The rest of the program categories could be added for each notebook.
Code: Select all
#!/bin/sh
# Program Launcher
iconfind() {
[ -f /usr/local/lib/X11/mini-icons/$ICON ] && ICON=/usr/local/lib/X11/mini-icons/$ICON
[ -f /usr/local/lib/X11/pixmaps/$ICON ] && ICON=usr/local/lib/X11/pixmaps/$ICON
[ -f /usr/share/pixmaps/$ICON ] && ICON=/usr/share/pixmaps/$ICON
[ -f /usr/local/share/pixmaps/$ICON ] && ICON=/usr/local/share/pixmaps/$ICON
#ICON=`find /usr -name "$ICON" -print -quit`
echo $ICON #exit
}
export -f iconfind
for DESKTOP_FILE in /usr/share/applications/*.desktop ; do
ICON="" CATS="" NAME="" EXEC="" LINE="" #prevent carryover from previous file
while read LINE || [ "$LINE" ]; do
case $LINE in
Name=*) NAME="${LINE#*=}"'' ;;
Icon=*) ICON="${LINE#*=}"''
[[ ! "$ICON" == */* ]] && iconfind ;;
Categories=*) CATS="${LINE#*=}"'' ;;
Exec=*) EXEC="${LINE#*=}"'' ;;
esac
done < $DESKTOP_FILE
case "$CATS" in
FileManager|X-FilesystemMount|X-FilesystemFind|X-FilesystemUtility) APPLIST_FILESYSTEM="$APPLIST_FILESYSTEM<button><label>$NAME</label><input file>$ICON</input><action>$EXEC</action></button>" ;;
X-Graphic-paint|RasterGraphics|X-Graphic-draw|VectorGraphics|X-Graphic-flow|Chart|Flowchart|Presentation|X-Graphic-viewer|X-Graphic-camera|Photography|X-Graphic-scanner|Scanning|OCR|X-Graphic-print|X-Graphic-utility|X-GraphicUtility) APPLIST_GRAPHICS="$APPLIST_GRAPHICS<button><label>$NAME</label><input file>$ICON</input><action>$EXEC</action></button>" ;;
esac
done
export LAUNCHER='
<window title="Program Launcher">
<vbox>
<notebook labels="Filesystem|Graphic">
<frame>
<text use-markup="true"><label>"<b>Filesystem</b>"</label></text>
'"$APPLIST_FILESYSTEM"'
</frame>
<frame>
<text use-markup="true"><label>"<b>Graphic</b>"</label></text>
'"$APPLIST_GRAPHICS"'
</frame>
</notebook>
<hbox homogeneous="true">
<button cancel></button>
</hbox>
</vbox>
</window>'
gtkdialog -p LAUNCHER
Cheers,
s
seaside, that's interesting -- I like the Icon Finder part -- but I'm afraid I don't think it'll work for me. I want the GtkNotebook to update whenever someone runs a "fixmenus" style script -- such as the one attached to my last post. The script you posted doesn't allow for that
Can someone PLEASE look at my script and tell me if there are any bugs?
Can someone PLEASE look at my script and tell me if there are any bugs?