Building MMview, a universal file viewer

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#271 Post by greengeek »

MochiMoppel wrote:Why would you need whitespace? Just rightclick any item in the list.
Ahhh yes. My apologies. I had no idea that was possible. I thought rightclicking an item would only bring up an item-specific context but yes that gives me the "view hidden files" option.

many thanks!

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#272 Post by MochiMoppel »

greengeek wrote:Ahhh yes. My apologies. I had no idea that was possible.
I bet hardly anybody has an idea what else is possible.

The GtkFileChooserDialog contains lots of built in but poorly documented keyboard shortcuts.
For example Ctrl+H toggles "View hidden files" on/off (this shortcut is now "taken" in MMview by the hexdump command, but I think I should restore it with the next update. You can still try it in older versions or in Geany's "Open" dialog).
Or try Alt+Home. Or avoid Alt+S (opens Search box... I should block it).

My favorite is F8, followed by any of keys Up,Down,Left,Right,Home,End,PageUp,PageDown. Neat, isn't it? Not extremely useful, but it shows how the developers of GTK -sometimes - care for details.

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#273 Post by tallboy »

Uhh, what should happen when F8 is pressed, followed by an arrow key? I have the 2019-04-09 version, and nothing happens, and that's not neat.
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#274 Post by greengeek »

I see the panel divisions move - expanding and contracting. (Xenial64). Clever way to make things more readable.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#275 Post by MochiMoppel »

tallboy wrote:Uhh, what should happen when F8 is pressed, followed by an arrow key?
With a properly designed GTK theme you would immediately see something just by pressing F8, without pressing some of the arrow keys I mentioned.

Your chooser would have a separator between the left "Places" pane and the file tree with a dotted handle in the middle. This separator would get focus and you should see it because its color changes. Figuring then out what the arrow keys are supposed to do is not difficult.

With an inferior theme you will see nothing.
Are you by any chance using the "Polished-Blue" theme? The author ("I don't know a ton about gtk themes") managed to eliminate the handle and the visible focus change indicator.

To get the handle back delete or comment out the lines

Code: Select all

image
{
function          = HANDLE
file              = "bump.png"
border            = { 2, 2, 2, 2 }
stretch           = TRUE
}
in the file /usr/share/themes/Polished-Blue/gtk-2.0/gtkrc. Or change to a better theme.

mfb

#276 Post by mfb »

Hi MochiMoppel,

The Polished-Blue gtkrc file has some major advantages as well as the defect referenced in your comment.

The attached screen shot shows some extra features at lines 29 and 30 enabling "steppers" see the bottom right corner of the screen shot.

There may well be other themes with such advantages, but, it seems to me, that although "The author of Polished-Blue wrote ("I don't know a ton about gtk themes") that overlooks its major contributions including the ease of making adjustments.
Attachments
shot.jpg
(86.58 KiB) Downloaded 723 times

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#277 Post by greengeek »

Not sure if I am using mmview correctly - but I would like to understand the following behaviour:

if I create a directory as follows:

/root/SoftwareTests_Pets_For_Slacko5.6_Only

the full name does not appear in the mmview left hand "Places" pane when I click "+". (It is truncated by the separator bar)

If I press F8 the separator bar is highlighted and I can press the right hand arrow (or grab the newly highlighted grab handle) to move the separator such that it displays the full directory name.

This is helpful - but it also shrinks that next pane.

Is there maybe some way to get the next pane to increase size using a similar method also??

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#278 Post by tallboy »

MochiMoppel, regarding our conversation: I also use the 'Polished Blue' theme, it may be default in Dpup Stretch-75 RC4.
Commenting the lines in .../Polished-Blue/gtk-2.0/gtkrc did not change anything, switching to another theme did. :D
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#279 Post by MochiMoppel »

greengeek wrote:If I press F8 the separator bar is highlighted and I can press the right hand arrow (or grab the newly highlighted grab handle) to move the separator such that it displays the full directory name.

This is helpful - but it also shrinks that next pane.

Is there maybe some way to get the next pane to increase size using a similar method also??
No. Because this is exactly how paned areas in GTK should work. When size of one pane increases, the adjacent pane shrinks. The left Places pane and the adjacent file tree pane are "glued" with a GtkPane widget, and the overall size of this widget does not change. All hardwired in the chooser widget. No way (and no reason) to change it. And here is more bad news for you: There is no way to add a similar separator between the file tree pane and the right viewer pane. The GtkPane widget is implemented in yad, but not in gtkdialog.

But coming back to your problem: Your idea to solve it is strange. Instead of trying to accommodate the Places pane to the length of your bookmarks, thus wasting valuable real estate, why don't you simply make your bookmarks shorter? Right-click -> Rename and then change "SoftwareTests_Pets_For_Slacko5.6_Only" to something like "SWtests5.6". All bookmarks in the list come with tooltips that display the full paths, so you are never left in doubt what even a cryptic bookmark is linked to.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#280 Post by greengeek »

MochiMoppel wrote:why don't you simply make your bookmarks shorter? Right-click -> Rename and then change "SoftwareTests_Pets_For_Slacko5.6_Only" to something like "SWtests5.6". All bookmarks in the list come with tooltips that display the full paths, so you are never left in doubt what even a cryptic bookmark is linked to.
Ahhh yes - it seems that renaming a "Places" bookmark does not rename the target directory. Nice to know. Thank you!

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#281 Post by MochiMoppel »

greengeek wrote:Ahhh yes - it seems that renaming a "Places" bookmark does not rename the target directory
It "seems" ? :lol:
If you are not convinced then start MMview, use your preferred method to display hidden files and have a look at /root/.gtk-bookmarks. This is the file where GTK reads and writes bookmarks. I hope you are impressed by the simplicity of this file and by the way, custom names are added to bookmarked directories. By a single space. The idea of a genius.

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#282 Post by rockedge »

setup mm_view on a Void Linux / Puppy Linux hybrid OS....works great...going to be using it as a main tool in the WeeDog (firstrib) OS's built from wiak's scripts described here ->

http://murga-linux.com/puppy/viewtopic.php?t=116212

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#283 Post by rockedge »

I am have trouble getting the quick view to work on the latest versions of WeeDog based on Void Linux. Earlier test versions of WeeDog MM_VIEW was working well. Now mm_view seems to work for example I can hex dump a file and see the text, but for some reason the quick view will not function....


Can anyone give a tip on how to get mm_view to work on WeeDog and Void Linux once again?

Code: Select all

_sh-5.0# /usr/bin/mm_view_20190702
widget_menuitem_create(): <width> not implemented for this widget.
timeout: invalid option -- t
BusyBox v1.30.0 (2018-12-30 22:25:27 CET) multi-call binary.

Usage: timeout [-s SIG] SECS PROG ARGS

Runs PROG. Sends SIG to it if it is not gone in SECS seconds.
Default SIG: TERM.
environment: line 18: file: command not found
environment: line 18: file: command not found
MAIN_DIALOG=""
vBTN_DISABLEVIEW="false"
vBTN_WRAP="false"
vCHOOSER="/root/Build/shinobi_recipe.txt"
vCMDLINE=""
vDURATION="156613867760"
vHIDDEN_RESTARTBUTTON=""
vMACRO_REFRESH=""
vMACRO_REFRESH_FORCE=""
vMENU_CHAR2HEX=""
vMENU_CMDBOX_OPEN=""
vMENU_DISABLEVIEW="false"
vMENU_HEXDUMP_ALL=""
vMENU_HEXDUMP_HEAD=""
vMENU_HEXDUMP_HELP=""
vMENU_HEXMARK_ALL=""
vMENU_HEXMARK_HEAD=""
vMENU_LAYOUT="false"
vMENU_PLAY="false"
vMENU_VIEWHISTORY=""
vMENU_WRAP="false"
vNOTE="0"
vSTATUSBAR="/root/Build/shinobi_recipe.txt â "
vTSTART="156613867759
"
EXIT="OK"
_

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#284 Post by greengeek »

Looks like it may be to do with the -t option issue highlighted on the previous page by radky and mochimoppel http://murga-linux.com/puppy/viewtopic. ... 80#1031680

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#285 Post by wiak »

greengeek wrote:Looks like it may be to do with the -t option issue highlighted on the previous page by radky and mochimoppel http://murga-linux.com/puppy/viewtopic. ... 80#1031680
'Fix' was to match GNU coreutils timeout syntax:

https://github.com/mirror/busybox/commi ... dfbc66075b

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#286 Post by MochiMoppel »

rockedge wrote:I am have trouble getting the quick view to work on the latest versions of WeeDog based on Void Linux. Earlier test versions of WeeDog MM_VIEW was working well.
Thanks rockedge for your error report and your PMs with your screenshot. This made me look again at your error messages.
There are three:

Code: Select all

widget_menuitem_create(): <width> not implemented for this widget.
As I told you in my PM I have no idea what this refers to.
In MMview there is no "widget_menuitem_create()" function and in GTK - as far as I read the documentation - there is no such function either. In menus <width> is used for icons in menuitems and AFAIK supported since the earliest version of gtkdialog, so "widget_menuitem_create()" remains a mystery. Maybe other members can help.

Code: Select all

BusyBox v1.30.0 (2018-12-30 22:25:27 CET) multi-call binary. 

Usage: timeout [-s SIG] SECS PROG ARGS 

Runs PROG. Sends SIG to it if it is not gone in SECS seconds. 
Default SIG: TERM.
This was an easy one. Cause and remedies are known and as I understand you fixed it already. In any case this affects only the display for directories and not text or image files.

Code: Select all

environment: line 18: file: command not found
This is the one I overlooked and which is responsible for your dysfunctional viewer pane. Your system lacks or can't find the file command. MMview wouldn't work without it. I took it for granted that every Puppy has it installed.

Looks like "Void Linux" is a little bit too void :wink:

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#287 Post by wiak »

Please refer to my next post for where error seems to come from in detail. Hope that allows issue to be sorted out easily.
MochiMoppel wrote:

Code: Select all

widget_menuitem_create(): <width> not implemented for this widget.
As I told you in my PM I have no idea what this refers to.
In MMview there is no "widget_menuitem_create()" function and in GTK - as far as I read the documentation - there is no such function either. In menus <width> is used for icons in menuitems and AFAIK supported since the earliest version of gtkdialog, so "widget_menuitem_create()" remains a mystery. Maybe other members can help.

Code: Select all

GtkWidget *widget_menuitem_create(
	AttributeSet *Attr, tag_attr *attr, gint Type)
{
	#define           TYPE_MENUITEM 0
	#define           TYPE_MENUITEM_IMAGE_STOCK 1
	#define           TYPE_MENUITEM_IMAGE_ICON 2
	#define           TYPE_MENUITEM_IMAGE_FILE 3
	#define           TYPE_MENUITEM_CHECK 4
	#define           TYPE_MENUITEM_RADIO 5
	#define           TYPE_MENUITEM_SEPARATOR 6
	GdkPixbuf        *pixbuf;
	GError           *error = NULL;
	GList            *element;
	GtkAccelGroup    *accel_group = NULL;
	GtkIconTheme     *icon_theme;
	GtkWidget        *image;
	GtkWidget        *widget;
	gchar             accel_path[64];
	gchar            *active;
	gchar            *icon_name, *image_name;
	gchar            *label, *stock_id;
	gchar            *value;
	gint              is_active;
	gint              menuitemtype = TYPE_MENUITEM;
	gint              width = -1, height = -1, size = 16;
guint accel_key = 0, accel_mods = 0, custom_accel = 0;
That function is in gtkdialog widget_menuitem.c:

https://github.com/01micko/gtkdialog/bl ... menuitem.c

I don't know what the issue is at the moment though. Presumably, <width> not implemented. Checks docs for the function advised (on 01micko's github gtkdialog site - will double check where - been a long time since I looked at any of this):

http://01micko.com/reference/

Above is the reference but I don't know if it documents the issue anyway - like I say I haven't been working with this stuff for too long to help further just now.
MochiMoppel wrote:Looks like "Void Linux" is a little bit too void :wink:
Void must be awful then... (but rockedge knows how to install 'file' package - don't worry about that).

wiak
Last edited by wiak on Tue 20 Aug 2019, 03:37, edited 1 time in total.

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#288 Post by wiak »

https://github.com/01micko/gtkdialog/bl ... menuitem.c

Here is where the error seems to come from I think. Maybe the comment-line at the top explains the issue.

wiak

Code: Select all

	/* Only image menuitems from theme or file support this */
	if (attributeset_is_avail(Attr, ATTR_WIDTH)) {
		if (menuitemtype == TYPE_MENUITEM_IMAGE_ICON ||
			menuitemtype == TYPE_MENUITEM_IMAGE_FILE) {
			width = atoi(attributeset_get_first(&element, Attr, ATTR_WIDTH));
		} else {
			fprintf(stderr, "%s(): <width> not implemented for this widget.\n",
				__func__);
		}
}
So I guess must be issue involving:

/* Only image menuitems from theme or file support this */

It seems that the "menuitemtype" currently being used in rockedges set up isn't one of these (icon issue?):

(menuitemtype == TYPE_MENUITEM_IMAGE_ICON ||
menuitemtype == TYPE_MENUITEM_IMAGE_FILE)

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#289 Post by rockedge »

Thank you everyone for the spot on help. I was missing "file" in my WeeDog (Void Linux base) After installing file, MMview (mm_view_20190702) is working once again.

Only the warning

Code: Select all

widget_menuitem_create(): <width> not implemented for this widget.
shows up when MMview is started from the command line but everything seems to be working well otherwise.

I have included "file" now in the WeeDog firstbuild.plug build recipe script since I had missed that file was not included in the Void Linux base-minimal package.

A screenshot of WeeDog (firstrib-s102) based on Void Linux binaries
Attachments
2019-08-20-112752_600px.png
(126.06 KiB) Downloaded 769 times

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#290 Post by perdido »

Couple icons for MMview desktop are no longer available, MM explains where the "official" icon resides in the post following this one.
Last edited by perdido on Sun 25 Aug 2019, 11:02, edited 1 time in total.

Post Reply