Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 22 Jul 2014, 11:42
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to setup a menuitem for input into editor? solved
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
oldyeller


Joined: 15 Nov 2011
Posts: 772
Location: Mishawaka IN

PostPosted: Thu 21 Feb 2013, 16:14    Post subject:  How to setup a menuitem for input into editor? solved  

Hello Everyone,

I have been trying for last 2hrs too take the menuitem so that it inputs a file into the editor for reading.

Code:
<menu label="_Timelines" use-underline="true">
   <menuitem stock-id="gtk-open" label="1">
      <action>cat > '$WORKDIR'/001 > '$WORKDIR'/reading</action>
      <action>refresh:EDITOR</action>
      </menuitem>
   
   </menu>


If I need to show all the code let me know and I will post that as well.

Thanks for any help

Cheers

Last edited by oldyeller on Fri 22 Feb 2013, 04:16; edited 1 time in total
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1036

PostPosted: Thu 21 Feb 2013, 19:54    Post subject:  

Hey Oldyeller

The first > is unnecessary, should be cat '$WORKDIR'/1 > ...

Just in case - a stand alone example. Wink
Code:
#! /bin/bash

WORKDIR=/tmp
echo "blablabla" > $WORKDIR/reading
echo "completely different blablabla" > $WORKDIR/1

export MAIN='
<window>
  <vbox>
    <menubar>
      <menu label="_Timelines" use-underline="true">
        <menuitem stock-id="gtk-open" label="1">
          <action>cat '$WORKDIR'/1 > '$WORKDIR'/reading</action>
          <action>refresh:EDITOR</action>
        </menuitem>
      </menu>
    </menubar>
    <edit>
      <variable>EDITOR</variable>
      <input file>'$WORKDIR'/reading</input>
    </edit>
  </vbox>
</window>
'

gtkdialog -p MAIN

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 772
Location: Mishawaka IN

PostPosted: Thu 21 Feb 2013, 21:20    Post subject:  

Hi SFR,

Will give it a try with the rest of my code.

Will this allow me to use a input file with the information that I want displayed or will I need to type it in for the echo as you did for the example.


Cheers
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1036

PostPosted: Fri 22 Feb 2013, 04:23    Post subject:  

Yes, I just used 'echo' to make sure that input files for <edit> do exist and are not empty.
It will work with any textual files.

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0510s ][ Queries: 12 (0.0079s) ][ GZIP on ]